CreateTimerAt 创建一个定点Timer 并将Timer添加到分层时间轮中, 返回Timer的tID
(df *DelayFunc, unixNano int64)
| 63 | |
| 64 | // CreateTimerAt 创建一个定点Timer 并将Timer添加到分层时间轮中, 返回Timer的tID |
| 65 | func (ts *TimerScheduler) CreateTimerAt(df *DelayFunc, unixNano int64) (uint32, error) { |
| 66 | ts.Lock() |
| 67 | defer ts.Unlock() |
| 68 | |
| 69 | ts.IDGen++ |
| 70 | return ts.IDGen, ts.tw.AddTimer(ts.IDGen, NewTimerAt(df, unixNano)) |
| 71 | } |
| 72 | |
| 73 | // CreateTimerAfter 创建一个延迟Timer 并将Timer添加到分层时间轮中, 返回Timer的tID |
| 74 | func (ts *TimerScheduler) CreateTimerAfter(df *DelayFunc, duration time.Duration) (uint32, error) { |
nothing calls this directly
no test coverage detected