Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PerformTask ¶
func PerformTask(userTask func() error, opts *TriggerOptions) error
PerformTask invokes the function using the given trigger options to decide when to invoke the task
Types ¶
type TriggerCallbackFunc ¶
TriggerCallbackFunc is a callback function that are used by scheduler APIs to decide when to trigger/perform actions. the function should return true, when it is the right time to perform the respective action
type TriggerOptions ¶
type TriggerOptions struct { // TriggerCb is the callback function to invoke to check trigger condition TriggerCb TriggerCallbackFunc // TriggerCheckInterval is the interval at which to check the trigger conditions TriggerCheckInterval time.Duration // TriggerCheckTimeout is the duration at which the trigger checks should timeout. If the trigger TriggerCheckTimeout time.Duration // BlockForTrigger if set true will block the call until the TriggerCb either passes or times out BlockForTrigger bool }
TriggerOptions are common options used to check if any action is okay to be triggered/performed
Click to show internal directories.
Click to hide internal directories.