Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoNotRerun ¶
DoNotRerun is a special wrapper for the error so it knows not to be reran.
func InitScheduler ¶
func InitScheduler()
InitScheduler is used to initialise the scheduler. This should only be called once.
Types ¶
type Job ¶
type Job[T any] struct { // contains filtered or unexported fields }
Job is used to define a schedule job handler. Should not be created manually, use NewJob instead.
func NewJob ¶
NewJob is used to create a new scheduler job type. The returned struct can be used to interact with it.
func (Job[T]) RunAndBlock ¶
RunAndBlock is used to run the job right away and block until it is done. This does not put it into the scheduler queue and is mainly used for config testing.
type Metadata ¶
type Metadata struct { // Retries is the number of times this task will be retried with each run decrementing 1. // A start of 0 here means unlimited. Retries uint // Timeout is used to define the timeout of the job. Timeout time.Duration // RefireDuration is the duration that should be slept if this is refired. RefireDuration time.Duration }
Metadata is used to define the metadata relating to a scheduler.
Click to show internal directories.
Click to hide internal directories.