Documentation
¶
Overview ¶
Package scheduler runs recurring background jobs at fixed intervals.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
// Name is used in log output.
Name string
// Interval is how often the job runs.
Interval time.Duration
// Fn is the work to perform. It receives a context that is cancelled when
// the scheduler is stopped.
Fn func(ctx context.Context)
}
Job describes a recurring background task.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler runs a set of Jobs at their configured intervals. Jobs run sequentially within their own goroutine; they do not block each other.
Click to show internal directories.
Click to hide internal directories.