Skip to content

Commit

Permalink
task: stabilize consume_budget (#6622)
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Jun 8, 2024
1 parent 833ee02 commit 53b586c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
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

0 comments on commit 53b586c

Please sign in to comment.