rfyiamcool / go-timewheel

golang timewheel similar to glang std timer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AddCron 可否增加一个真正的 Cron 实现

hellodword opened this issue · comments

谢谢作者的 go-timewheel

比如有大量的 schedule 是期望在具体的时间点执行 (例如 on.schedule), 而不是根据程序启动的时间来直接计算时间间隔, 很希望 go-timewheel 可以有这样的实现, 或者是一个基于 go-timewheel 实现的 example, 感谢!

目前采用的是执行两次的方式实现, 先计算离下一次时间, 用 Add 实现最近的一次执行, 然后在 callback 中 AddCron