How the hierarchical timer wheel works
masterRatas uses a hierarchical timer wheel to manage events scheduled for the future. A timer wheel is a ring buffer of linked lists of events. As time advances, a pointer moves through the buffer, executing events in the slots it passes.
To handle long-term scheduling, the implementation layers multiple wheels at different resolutions. When an event is scheduled too far in the future for the innermost (core) wheel, it is placed in an outer wheel. As the inner wheels rotate, events are 'promoted' from outer wheels to inner wheels until they reach the core wheel and are ready for execution.