Tracking Issue for LocalWaker
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Feature gate: #![feature(local_waker)]
This is a tracking issue for support for local wakers on Context. This allows libraries to hold non thread safe data on their wakers, guaranteeing at compile time that the wakers will not be sent across threads. It includes a ContextBuilder type for building contexts.
Public API
impl Context {
fn local_waker(&self) -> &LocalWaker;
}
impl<'a> ContextBuilder<'a> {
fn from_waker(waker: &'a Waker) -> ContextBuilder<'a>;
fn waker(self, waker: &'a Waker) -> ContextBuilder<'a>;
fn local_waker(self, local_waker: &'a LocalWaker,) -> ContextBuilder<'a>
fn build(self) -> Context;
}
impl From<&mut Context> for ContextBuilder;
pub trait LocalWake {
fn wake(self: Rc<Self>);
}
Steps / History
- Implementation:
- Have the @rust-lang/wg-async approve the API
- Final comment period (FCP)^1
- Stabilization PR
Unresolved Questions
- Should runtimes be allowed to not define a waker?
Relevant links
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the local_waker feature gate and the public API listed in this tracking issue, then read implementation PR #118960 and the linked libs-team discussions. The remaining work is API approval, resolving whether runtimes may omit a waker, completing FCP, and opening a stabilization PR; no implementation file or test is named here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100