Documentation ¶
Overview ¶
Package scheduledtask implements a task scheduler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
A Job is a function that is scheduled to run periodically.
The Job itself controls its schedule by returning the next time it should run.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler is a task scheduler for the controller.
Each job runs in its own goroutine.
The scheduler uses a consistent hash ring to attempt to ensure that jobs are only run on a single controller at a time. This is not guaranteed, however, as the hash ring is only updated periodically and controllers may have inconsistent views of the hash ring.
func New ¶
func New(ctx context.Context, id model.ControllerKey, getControllers func(ctx context.Context, all bool) ([]dal.Controller, error)) *Scheduler
New creates a new Scheduler.
Click to show internal directories.
Click to hide internal directories.