Documentation ¶
Overview ¶
Package goscheduler provides a task scheduler with configurable concurrency limits.
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
}
func (*Scheduler) Close ¶
func (s *Scheduler) Close()
Close stops the scheduler from running. Currently running jobs will not be cancelled by this call but no new jobs will be started.
func (*Scheduler) Init ¶
Init initializes the task scheduler with a specified number of concurrent workers.
func (*Scheduler) RepeatEvery ¶
RepeatEvery adds a task to the scheduler that is invoked every interval.
interval time.Duration - The interval between the previous execution finishing and the next one starting. action func() bool - The action to execute when the job is ready to run. Return false to stop future invocations.
func (*Scheduler) RepeatForCount ¶
RepeatForCount adds a task to the scheduler that is invoked at intervals for a fixed number of times.
count int - The number of times the job should be run. interval time.Duration - The interval between the previous execution finishing and the next one starting. action func() bool - The action to execute when the job is ready to run. Return false to stop future invocations.
Click to show internal directories.
Click to hide internal directories.