V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
iamecho

时间轮的 golang 实现 https://github.com/wgliang/timewheel

  •  
  •   iamecho · Nov 25, 2016 · 1810 views
    This topic created in 3453 days ago, the information mentioned may be changed or developed.

    时间轮是一个固定大小的数组结构,这个数组的每一个槽(元素)代表着软定时器的精度,(类似于时钟的最小刻度).时间轮的优点:通过排序的时间列表来有效的更新 timers.它能非常效率地增加,取消 timer.

    定时器的替代者,基于链表,自定义回调函数 应用于网络连接的过期失效,会话失效以及业务资源的自动释放和销毁失效等等 https://github.com/wgliang/timewheel

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3257 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:42 · PVG 21:42 · LAX 06:42 · JFK 09:42
    ♥ Do have faith in what you're doing.