Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
I've been talking to @carllerche over the last few weeks about simplifying the implementation of the timer and delay implementation within the existing interface. This is the first stab at that refactor.
Solution
Changes included in this PR:
wheel::Poll
struct. it appears to be a pretty thin wrapper aroundu64
that provides limited functionality/valuedelay_queue
module completely. in chatting with @carllerche it sounds like we're planning on moving that totokio-util
anywaysdelay_queue
is removed, we don't need the generic behavior that allows the timer wheel to operate on both a slab and stack state directly - the only concrete store used is the stack directly. so now that it is removed we can make the timer wheel non-generic.Registration
struct, which appears to be a fairly thin wrapper around theEntry
struct with limited functionality/value.This is my first foray into the tokio ecosystem, so it's very likely that I'm missing the motivation around why things are the way they currently are - very open to suggestions and corrections. I also view this as the first in a few different efforts to rework the timer implementation. My next area of focus will be to reduce the amount of state that is shared across the
Entry
struct, which is the point of synchronization between the timer driver and theDelay
itself. Reducing the surface area ofEntry
will probably make the delay implementation slimmer and easier to reason about. I'm open to suggestions on that future work as well.