Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task: stabilize consume_budget #6622

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions tokio/src/task/consume_budget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ use std::task::Poll;
/// computations that do not use Tokio resources like sockets or semaphores,
/// without redundantly yielding to the runtime each time.
///
/// **Note**: This is an [unstable API][unstable]. The public API of this type
/// may break in 1.x releases. See [the documentation on unstable
/// features][unstable] for details.
///
/// # Examples
///
/// Make sure that a function which returns a sum of (potentially lots of)
Expand All @@ -27,8 +23,7 @@ use std::task::Poll;
/// sum
/// }
/// ```
/// [unstable]: crate#unstable-features
#[cfg_attr(docsrs, doc(cfg(all(tokio_unstable, feature = "rt"))))]
#[cfg_attr(docsrs, doc(cfg(feature = "rt")))]
pub async fn consume_budget() {
let mut status = Poll::Pending;

Expand Down
6 changes: 2 additions & 4 deletions tokio/src/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,8 @@ cfg_rt! {
mod yield_now;
pub use yield_now::yield_now;

cfg_unstable! {
mod consume_budget;
pub use consume_budget::consume_budget;
}
mod consume_budget;
pub use consume_budget::consume_budget;

mod local;
pub use local::{spawn_local, LocalSet, LocalEnterGuard};
Expand Down
Loading