Documentation ¶
Index ¶
- type Execute
- type TimingWheel
- func (tw *TimingWheel) Drain(fn func(key, value interface{}))
- func (tw *TimingWheel) GetValue(key string) (interface{}, bool)
- func (tw *TimingWheel) Len() int
- func (tw *TimingWheel) MoveTimer(key interface{}, delay time.Duration)
- func (tw *TimingWheel) RemoveTimer(key interface{})
- func (tw *TimingWheel) SetTimer(key, value interface{}, delay time.Duration)
- func (tw *TimingWheel) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Execute ¶
type Execute func(key, value interface{})
Execute defines the method to execute the task.
type TimingWheel ¶
type TimingWheel struct {
// contains filtered or unexported fields
}
A TimingWheel is a timing wheel object to schedule tasks.
func NewTimingWheel ¶
NewTimingWheel returns a TimingWheel.
func (*TimingWheel) Drain ¶
func (tw *TimingWheel) Drain(fn func(key, value interface{}))
Drain drains all items and executes them.
func (*TimingWheel) GetValue ¶
func (tw *TimingWheel) GetValue(key string) (interface{}, bool)
func (*TimingWheel) Len ¶
func (tw *TimingWheel) Len() int
func (*TimingWheel) MoveTimer ¶
func (tw *TimingWheel) MoveTimer(key interface{}, delay time.Duration)
MoveTimer moves the task with the given key to the given delay.
func (*TimingWheel) RemoveTimer ¶
func (tw *TimingWheel) RemoveTimer(key interface{})
RemoveTimer removes the task with the given key.
func (*TimingWheel) SetTimer ¶
func (tw *TimingWheel) SetTimer(key, value interface{}, delay time.Duration)
SetTimer sets the task value with the given key to the delay.
Click to show internal directories.
Click to hide internal directories.