task: stabilize consume_budget (#6622)

This commit is contained in:
Rob Ede
2024-06-08 22:17:06 +02:00
committed by GitHub
parent 833ee027d0
commit 53b586c5b9
2 changed files with 3 additions and 10 deletions
+1 -6
View File
@@ -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)
@@ -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;
+2 -4
View File
@@ -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};