tasks

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForceStop

func ForceStop(duration time.Duration, task goasync.Task) *forceStop

PARAMETERS:

  • 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

ForceStop Tasks are used to ensure a forceful termination even if subTasks don't properly stop executing

func Interruptible

func Interruptible(signals []os.Signal, task goasync.Task) *interruptible
PARAMETERS:
- signals: OS signals to capture and initiate the reload operation
- task: task process that is wrapped to handle interruptions

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.

func RepeatTimer

func RepeatTimer(repeatTime time.Duration, task goasync.Task) *repeatTimer
PARAMETERS:
- repeatTime - amount of time to wait between invoking the subTask
- task - task process that is wrapped for the periodic timer

RepeatTimer Executers are used to run periodic one off tasks on a timer.

func Repeatable

func Repeatable(task goasync.Task) *repeatable
PARAMETERS:
- task - task process that is wrapped for the periodic timer

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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