Documentation ¶
Overview ¶
Package timer 定时器 优先级:加入顺序,到期
Index ¶
Constants ¶
View Source
const ( ScanSecondDurationDefault = time.Millisecond * 100 ScanMillisecondDurationDefault = time.Millisecond * 25 )
Variables ¶
This section is empty.
Functions ¶
func DelMillisecond ¶
func DelMillisecond(t *Millisecond)
DelMillisecond 删除毫秒级定时器
NOTE 必须与该timerOutChan线性处理.如:在同一个goroutine select中处理数据 参数: 毫秒定时器
Types ¶
type Mgr ¶
type Mgr struct {
// contains filtered or unexported fields
}
Mgr 定时器管理器
func (*Mgr) AddMillisecond ¶
func (p *Mgr) AddMillisecond(cb OnFun, arg interface{}, expireMillisecond int64) *Millisecond
AddMillisecond 添加毫秒级定时器
参数: cb:回调函数 arg:回调参数 expireMillisecond:过期毫秒数 返回值: 毫秒定时器
type Millisecond ¶
type Millisecond struct { Arg interface{} // 参数 Function OnFun // 超时调用的函数 // contains filtered or unexported fields }
Millisecond 毫秒级定时器
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options contains Options to configure instance. Each option can be set through setter functions. See documentation for each setter function for an explanation of the option.
func (*Options) WithOutgoingTimerOutChan ¶
func (*Options) WithScanMillisecondDuration ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.