MCPcopy
hub / github.com/aceld/zinx / RemoveTimer

Method RemoveTimer

ztimer/timewheel.go:141–150  ·  view source on GitHub ↗

RemoveTimer 删除一个定时器,根据定时器的ID

(tID uint32)

Source from the content-addressed store, hash-verified

139
140// RemoveTimer 删除一个定时器,根据定时器的ID
141func (tw *TimeWheel) RemoveTimer(tID uint32) {
142 tw.Lock()
143 defer tw.Unlock()
144
145 for i := 0; i < tw.scales; i++ {
146 if _, ok := tw.timerQueue[i][tID]; ok {
147 delete(tw.timerQueue[i], tID)
148 }
149 }
150}
151
152// AddTimeWheel 给一个时间轮添加下层时间轮 比如给小时时间轮添加分钟时间轮,给分钟时间轮添加秒时间轮
153func (tw *TimeWheel) AddTimeWheel(next *TimeWheel) {

Callers 1

CancelTimerMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected