Documentation
¶
Index ¶
- func ForceStop(duration time.Duration, task goasync.Task) *forceStop
- func Interruptible(signals []os.Signal, task goasync.Task) *interruptible
- func RepeatTimer(repeatTime time.Duration, task goasync.Task) *repeatTimer
- func Repeatable(task goasync.Task) *repeatable
- func Running(started chan struct{}) *running
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForceStop ¶
ForceStop Tasks are used to ensure a forceful termination even if subTasks don't properly stop executing
Args:
- duration: time to wait for subtask to finish. If this time is reached an error is returned and subTask is ignored
- task: task process that is wrapped to handle interruptions
func Interruptible ¶
Interruptible Tasks are used to run any tasks that can be reloaded at runtime. When this task recieves an interrupt signal it will cancel the child Task process and call Cleanup. Then this will call Initialize and Execute again for the child Task.
Args:
- signals: OS signals to capture and initiate the reload operation
- task: task process that is wrapped to handle interruptions
func RepeatTimer ¶
RepeatTimer Executeers are used to run periodic one off tasks on a timer. Args:
- repeatTime: amount of time to wait between invoking the subTask
- task: task process that is wrapped for the periodic timer
func Repeatable ¶
Repeatable Tasks are used to run any tasks that might fail with an error. This task will swallow ther `Run()` error for the passed in `task` argument and restart the process. Initialize and Cleanup errors are propigated as normal
func Running ¶
func Running(started chan struct{}) *running
Running can be used to to if a TaskManager has started executing background threads. This is useful to know is a task manager received a HUP operation and all tasks were restared. passing in a new Running task will let us know when the task manager has started again
NOTE: that this subtask will exit so its intended to be used with a "Relaxed" task manager.
Args: * started - chan that will be closed when Execute(...) is called
Types ¶
This section is empty.