5 Star 20 Fork 10

NightTC/Gobige

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
bucket.go 462 Bytes
一键复制 编辑 原始数据 按行查看 历史
buguang 提交于 2023-05-08 20:38 +08:00 . timerwheel
package timerwheel
/*
定时器上的最小刻度
*/
type bucket struct {
//在时间轮上的Key
TimerKey int64
//第一个
Root *taskModel
//最后一个
Prev *taskModel
}
func (this *bucket) AddTask(task *taskModel) {
if this.Prev == nil {
this.Root = task
this.Prev = task
} else {
this.Prev.Next = task
this.Prev = task
}
}
func (this *bucket) init() {
this.TimerKey = 0
this.Root = nil
this.Prev = nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/night-tc/gobige.git
git@gitee.com:night-tc/gobige.git
night-tc
gobige
Gobige
f7245e354ed4

搜索帮助