Documentation ¶
Overview ¶
periodic runs periodic tasks. Tasks can be registered to a Scheduler which may or may not be "ticking", i.e. running its tasks.
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler runs registered periodic tasks. Its zero value is a valid Scheduler that doesn't tick and has no registered task. It may be used in parallel.
func (*Scheduler) Register ¶
Register registers a Task to the Scheduler to be run at period p. If the Scheduler is ticking, the task starts ticking immediately.
func (*Scheduler) Start ¶
func (s *Scheduler) Start()
Start starts a Scheduler. Starting an already started scheduler is functionally a noop, though an error will be logged.
Click to show internal directories.
Click to hide internal directories.