Skip to content

Tracking Issue for task::Waker::noop #98286

Closed
@SabrinaJewson

Description

@SabrinaJewson

Feature gate: #![feature(noop_waker)]

This is a tracking issue for task::Waker::noop, a way to easily crate task::Wakers that do nothing.

Public API

// core::task

impl Waker {
    #[must_use]
    pub const fn noop() -> &Waker { /* … */ }
}

Steps / History

Unresolved Questions

  • Should we also add RawWaker::noop()? (I don't think so, I can't think of a use case for it)
  • Should we also add Context::noop()? Depending on the direction Context goes a “noop context” might not even make sense in future.
  • Should it be an associated constant instead? That would allow for let cx = &mut Context::from_waker(&Waker::NOOP); to work on one line (without additional local variables) which is convenient.
    • The return type of Waker::noop() has now been changed to &Waker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCI-async-nominatedNominated for discussion during an async working group meeting.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.WG-asyncWorking group: Async & await

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions