Documentation ¶
Index ¶
- Constants
- func UnixTS() int64
- type DelayCall
- type HashWheel
- func (this *HashWheel) Add2WheelChain(tid uint32, t *SafeTimer) error
- func (this *HashWheel) AddNext(next *HashWheel)
- func (this *HashWheel) Count() int
- func (this *HashWheel) GetTriggerWithIn(ms int64) map[uint32]*SafeTimer
- func (this *HashWheel) RemoveFromWheelChain(tid uint32)
- func (this *HashWheel) RunWheel()
- type ParamNull
- type SafeTimer
- type SafeTimerScheduel
- type Timer
Constants ¶
View Source
const ( //默认安全时间调度器的容量 TIMERLEN = 2048 //默认最大误差值100毫秒 ERRORMAX = 100 //默认最大触发队列缓冲大小 TRIGGERMAX = 2048 //默认hashwheel分级 LEVEL = 12 )
协程安全的timer
View Source
const (
DEFAULT_LEVEL = 12
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HashWheel ¶
func NewHashWheel ¶
func (*HashWheel) Add2WheelChain ¶
func (*HashWheel) GetTriggerWithIn ¶
func (*HashWheel) RemoveFromWheelChain ¶
type SafeTimer ¶
type SafeTimer struct {
// contains filtered or unexported fields
}
func NewSafeTimer ¶
type SafeTimerScheduel ¶
func NewSafeTimerScheduel ¶
func NewSafeTimerScheduel() *SafeTimerScheduel
func (*SafeTimerScheduel) CancelTimer ¶
func (this *SafeTimerScheduel) CancelTimer(timerId uint32)
func (*SafeTimerScheduel) CreateTimer ¶
func (this *SafeTimerScheduel) CreateTimer(delay int64, f func(v ...interface{}), args []interface{}) (uint32, error)
func (*SafeTimerScheduel) GetTriggerChannel ¶
func (this *SafeTimerScheduel) GetTriggerChannel() chan *DelayCall
func (*SafeTimerScheduel) StartScheduelLoop ¶
func (this *SafeTimerScheduel) StartScheduelLoop()
Click to show internal directories.
Click to hide internal directories.