mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
task: stabilize consume_budget (#6622)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user