Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClosed = errors.New("scheduler is already closed") ErrInvalidWorkers = errors.New("workers must be more than 0") ErrInvalidTime = errors.New("time is invalid zero time") ErrInvalidTask = errors.New("task must not be nil") ErrTaskCancelled = errors.New("task cancelled") )
errors
View Source
var (
ErrMax = errors.New("heap max size")
)
errors
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler is used to schedule tasks.
func NewScheduler ¶
NewScheduler creates Scheduler and start scheduler and workers. number of created goroutines is counted to sync.WaitGroup.
func (*Scheduler) ChangeWorkers ¶
ChangeWorkers will change workers size. workers must greater than 0. if new size is smaller, shut appropriate number of workers down. if new size is bigger, create appropriate number of workers.
Click to show internal directories.
Click to hide internal directories.