Documentation
¶
Index ¶
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)
type Stopper ¶ added in v0.0.4
type Stopper interface {
// IsStopped returns true if the stopper already stopped
IsStopped() bool
// Chan returns a bool channel to be notified once stopped
Chan() chan bool
}
Stopper represents the object used to stop running functions should be used by the running function, once stopped the function act accordingly