Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler manages a set of scheduled jobs. Register jobs with Schedule, then call Start once to launch all goroutines.
Expected call ordering: all Schedule calls must precede Start; Stop must be called after Start and at most once. The scheduler is a one-shot object: once stopped it cannot be restarted because the internal channels are closed during shutdown. Individual methods are protected by an internal mutex, but calling them out of order returns an error.
func (*Scheduler) Schedule ¶
Schedule registers a job with its trigger and overlap policy. If job is nil, Schedule is a no-op and returns nil. Returns an error if called after Start.
func (*Scheduler) Start ¶
Start launches all scheduled jobs in the background and returns immediately. Returns an error if called more than once or after Stop.
func (*Scheduler) Stop ¶
Stop shuts down the scheduler and waits for all goroutines to exit. If force is false, the run context is cancelled and each dispatcher exits according to its policy: QueueAll flushes remaining queued events before returning; Skip, Queue, and Replace exit immediately without draining. If force is true, each relay clears its queue, cancels the in-flight job, and signals all dispatchers to exit immediately via forceCh before the run context is cancelled. Returns an error if called before Start.
Directories
¶
| Path | Synopsis |
|---|---|
|
jobs
|
|
|
Package taskschedule manages user-defined task schedules (task_schedule table).
|
Package taskschedule manages user-defined task schedules (task_schedule table). |