Documentation ¶
Index ¶
- Variables
- func After(delay time.Duration) <-chan time.Time
- func Remove(task *Task) error
- func ResetDefaultTimeWheel(tw *TimeWheel)
- func SetSyncPool(state bool) optionCall
- func Sleep(delay time.Duration)
- func TickSafeMode() optionCall
- type Task
- type Ticker
- type TimeWheel
- func (tw *TimeWheel) Add(delay time.Duration, callback func()) *Task
- func (tw *TimeWheel) AddCron(delay time.Duration, callback func()) *Task
- func (tw *TimeWheel) After(delay time.Duration) <-chan time.Time
- func (tw *TimeWheel) AfterFunc(delay time.Duration, callback func()) *Timer
- func (tw *TimeWheel) NewTicker(delay time.Duration) *Ticker
- func (tw *TimeWheel) NewTimer(delay time.Duration) *Timer
- func (tw *TimeWheel) Remove(task *Task) error
- func (tw *TimeWheel) Sleep(delay time.Duration)
- func (tw *TimeWheel) Start()
- func (tw *TimeWheel) Stop()
- type TimeWheelPool
- type Timer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultTimeWheel, _ = NewTimeWheel(time.Second, 120)
)
Functions ¶
func ResetDefaultTimeWheel ¶
func ResetDefaultTimeWheel(tw *TimeWheel)
func SetSyncPool ¶
func SetSyncPool(state bool) optionCall
func TickSafeMode ¶
func TickSafeMode() optionCall
Types ¶
type TimeWheel ¶
type TimeWheel struct {
// contains filtered or unexported fields
}
func NewTimeWheel ¶
NewTimeWheel create new time wheel
type TimeWheelPool ¶
type TimeWheelPool struct {
// contains filtered or unexported fields
}
func NewTimeWheelPool ¶
func (*TimeWheelPool) Get ¶
func (tp *TimeWheelPool) Get() *TimeWheel
func (*TimeWheelPool) GetRandom ¶
func (tp *TimeWheelPool) GetRandom() *TimeWheel
func (*TimeWheelPool) Start ¶
func (tp *TimeWheelPool) Start()
func (*TimeWheelPool) Stop ¶
func (tp *TimeWheelPool) Stop()
type Timer ¶
similar to golang std timer
func (*Timer) AddStopFunc ¶
func (t *Timer) AddStopFunc(callback func())
Click to show internal directories.
Click to hide internal directories.