Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LocalScheduler ¶
type LocalScheduler interface {
Schedule(Task)
}
LocalScheduler schedules task to a customized goroutine
type TimedSched ¶
type TimedSched struct {
// contains filtered or unexported fields
}
TimedSched represents the control struct for timed parallel scheduler. This scheduler also executes runnable tasks at the same go routine. It is inefficient for programs create and delete timers frequently, because leaving a lot of timers in the heap slows down addtimer. If your program create and delete a lot of short period timers, use a time-wheel mechanism such as https://github.com/andy2046/tik
func NewTimedSched ¶
func NewTimedSched(parallel int) *TimedSched
NewTimedSched creates a parallel-scheduler with given parallelization
func (*TimedSched) Put ¶
func (ts *TimedSched) Put(f func(), deadline time.Time)
Put a function 'f' awaiting to be executed at 'deadline'
Click to show internal directories.
Click to hide internal directories.