Add wake_at() methods to waker registrations#5787
Open
regicidalplutophage wants to merge 4 commits intoembassy-rs:mainfrom
Open
Add wake_at() methods to waker registrations#5787regicidalplutophage wants to merge 4 commits intoembassy-rs:mainfrom
regicidalplutophage wants to merge 4 commits intoembassy-rs:mainfrom
Conversation
leftger
requested changes
Apr 3, 2026
Contributor
leftger
left a comment
There was a problem hiding this comment.
I think it's a neat feature. My gut tells me you could feature-gate this at a minimum. The fact this crate hasn't needed these dependencies tells me you might need to reconsider where this belongs.
| turbowakers = [] | ||
|
|
||
| [dependencies] | ||
| embassy-time = {version = "0.5.1", path = "../embassy-time"} |
Contributor
There was a problem hiding this comment.
You're adding a new dependency to this crate. Is this the right place for this new functionality? Maybe you could gate this feature?
leftger
approved these changes
Apr 3, 2026
Member
|
The use case for this seems a bit niche, and it's something the user can do on their own easily, WakerRegistration is not that complex. Therefore I don't think it's worth making embassy-sync depend on embassy-time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I've been making a construct which is a little bit like a timer which we can await before we determined when it should return. Waker had to be registered upon the initial await. One caveat is that once registered it's private so the functionality of scheduling its waking has to be a method.
It might also be preferable just make the waker field public.