Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasicSchedule ¶
type BasicSchedule struct {
// contains filtered or unexported fields
}
func NewBasicSchedule ¶
func NewBasicSchedule() *BasicSchedule
func (*BasicSchedule) Set ¶
func (s *BasicSchedule) Set(name string, nexter Nexter)
func (*BasicSchedule) Tick ¶
func (s *BasicSchedule) Tick(runner taskrunner.TaskRunner, at time.Time) (map[string]*taskrunner.TaskStatus, error)
type Nexter ¶
type Nexter interface { // starting from "after", returns the time of the "next" event in the schedule, // which must be greater than "after". // A zero-value is used to indicate that no "next" event is known when // starting from the given time. Due to this, results are undefined when // "after" is a zero-value. Next(after time.Time) time.Time }
type Schedule ¶
type Schedule interface { // Schedules can be used as Nexters, Recursively Nexter // process all scheduled tasks which should run specifically "at" the given // time. In practice, the "at" parameter will be the result of the previous // call of Next(...) Tick(runner taskrunner.TaskRunner, at time.Time) (map[string]*taskrunner.TaskStatus, error) }
The Schedule controls when tasks are run. It is in charge of both determining when something needs to happen, and the actual passing of scheduled events to a TaskRunner. This allows a scheduler to independently decide not only when the "scheduled tasks" should be run, but also any retries, and anything to do with internal state manipulation.
Click to show internal directories.
Click to hide internal directories.