Documentation ¶
Index ¶
- func ExecWithInterval(fn StoppableFunc, start, limit time.Duration)
- func ExecWithTimeout(ctx context.Context, fn Func, t time.Duration) (bool, interface{}, error)
- func Retry(fn Fn, retries int) error
- func RetryWithContext(ctx context.Context, fn Fn, retries int) error
- type Fn
- type Func
- type Queue
- type StoppableFunc
- type Stopper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecWithInterval ¶ added in v0.0.4
func ExecWithInterval(fn StoppableFunc, start, limit time.Duration)
ExecWithInterval executes a function with a dynamic interval the interval is getting multiplied by 2 in each round, up to the given limit and then it starts all over 1s > 2s > 4s > 8s ... > 1s > 2s > ...
func ExecWithTimeout ¶
ExecWithTimeout triggers some function in the given time frame, returns true if completed
Types ¶
type Queue ¶ added in v0.0.18
type Queue interface { Start() Stop() Queue(fn Fn) QueueDistinct(Fn, string) Wait() Errors() []error }
Queue is an interface for event queue
func NewExecutionQueue ¶ added in v0.0.19
NewExecutionQueue creates a new instance
type StoppableFunc ¶ added in v0.0.4
StoppableFunc represents a function that returns two boolean to help with its execution stop will stop the interval, while continue will make the interval value to remain the same if both are false, the interval will be increased (x2)
Click to show internal directories.
Click to hide internal directories.