This repository was archived by the owner on Apr 2, 2018. It is now read-only.

Description
I saw this referenced on a Reddit thread and am curious about your implementation since there aren't many good open source versions. Also just like reading Rust code to get a little familiarity with it. Specifically,
- Why did you decide on a hashed wheel instead of hierarchical?
- Why did you make the tick amount configurable instead of fixed?
- Why not make use of power-of-two for shifts/mask instead of mult/div?
- When would you consider a heap more appropriate?
- Why did you make times relative to
start instead of making times tolerant to wrapping?
- What would happen when
max_capacity is exceeded?
I think that if you make it hierarchical, then you could schedule the next populated bucket instead of scanning in next_timeout.
Also curious on your thoughts of my implementation, e.g. if you have ideas for improvements. Unfortunately it has to be tightly coupled into the project's logic to avoid allocations, which is also why I didn't keep a wheel_idx on the timer. The could cause unnecessary shuffling, but that's cheap and batched which seemed preferable to extra memory. Its also passive and, admittedly, it took a little while to work out how to implement it efficiently due to a lack of good examples.