Documentation
¶
Index ¶
Constants ¶
View Source
const ( // SHUTDOWN_TIMEOUT is the max time to wait for running jobs on shutdown. SHUTDOWN_TIMEOUT = 60 * time.Second // DEFAULT_JOB_TIMEOUT is the maximum duration a job will run without its own deadline. DEFAULT_JOB_TIMEOUT = time.Hour )
TODO: Make this configurable via New options
Variables ¶
This section is empty.
Functions ¶
func ShouldRunLocalNow ¶
ShouldRunLocalNow returns true if the local time in tzName matches hour:minute exactly.
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler runs Jobs on a fixed tick schedule. It also supports one-shot jobs and prevents concurrent runs of the same logical task (by ID). For each distinct id, only one instance may run at the same time.
func (*Scheduler) Add ¶
Add registers a recurring job at the given slot (must be a multiple of granularity). id must be unique for each logical task; concurrent duplicates will be skipped.
func (*Scheduler) AddMany ¶
AddMany registers the same job on multiple slots. IDs must be distinct per logical task.
Click to show internal directories.
Click to hide internal directories.