Skip to content

Add wake_at() methods to waker registrations#5787

Open
regicidalplutophage wants to merge 4 commits intoembassy-rs:mainfrom
regicidalplutophage:main
Open

Add wake_at() methods to waker registrations#5787
regicidalplutophage wants to merge 4 commits intoembassy-rs:mainfrom
regicidalplutophage:main

Conversation

@regicidalplutophage
Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Contributor

@leftger leftger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread embassy-sync/Cargo.toml Outdated
turbowakers = []

[dependencies]
embassy-time = {version = "0.5.1", path = "../embassy-time"}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're adding a new dependency to this crate. Is this the right place for this new functionality? Maybe you could gate this feature?

@Dirbaio
Copy link
Copy Markdown
Member

Dirbaio commented Apr 3, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants