Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Threshold option represents the threshold at which batch task is enabled.
Threshold int
// IdleTime option represents the max idle time of the worker.
IdleTime time.Duration
// Interval option represents the check interval of the worker.
Interval time.Duration
}
Options represents options
type Scheduler ¶
type Scheduler interface {
// Schedule schedules the task to an idle worker.
Schedule(task func())
// NumWorkers returns the number of workers.
NumWorkers() int
// Close closes the task scheduler.
Close()
}
Scheduler represents a task scheduler.
func NewScheduler ¶
NewScheduler returns a new task scheduler.
Click to show internal directories.
Click to hide internal directories.