gg_promise

package
v0.2.37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SystemError  = errors.New("system_error")
	TimeOutError = errors.New("timeout_error")
)

Functions

func WaitFileExists

func WaitFileExists(filename string, waitFor time.Duration) (exists bool, err error)

Types

type ActionMethod

type ActionMethod[T ActionReturnType] func(args ...interface{}) (response T, err error)

type ActionReturnType

type ActionReturnType interface {
	interface{}
}

type Delegator

type Delegator struct {
	// contains filtered or unexported fields
}

func NewDelegator

func NewDelegator() (instance *Delegator)

func (*Delegator) Register

func (instance *Delegator) Register(funcName string, f FnSolve)

Register add a function

func (*Delegator) Run

func (instance *Delegator) Run(funcName string, args ...interface{}) (response interface{}, err error)

Run execute a function

func (*Delegator) RunTimed

func (instance *Delegator) RunTimed(funcName string, execTimeout time.Duration, args ...interface{}) (response interface{}, err error)

type FnSolve

type FnSolve func(args ...interface{}) (response interface{}, err error)

type TimeoutAction

type TimeoutAction[T ActionReturnType] struct {
	// contains filtered or unexported fields
}

func NewTimeout

func NewTimeout[T ActionReturnType](timeout time.Duration) *TimeoutAction[T]

func (*TimeoutAction[T]) IsPaused

func (instance *TimeoutAction[T]) IsPaused() bool

func (*TimeoutAction[T]) IsRunning

func (instance *TimeoutAction[T]) IsRunning() bool

func (*TimeoutAction[T]) Pause

func (instance *TimeoutAction[T]) Pause()

func (*TimeoutAction[T]) Resume

func (instance *TimeoutAction[T]) Resume()

func (*TimeoutAction[T]) Run

func (instance *TimeoutAction[T]) Run(method ActionMethod[T], args ...interface{}) (response T, err error)

func (*TimeoutAction[T]) Stop

func (instance *TimeoutAction[T]) Stop()

Stop ... stops the task

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL