Expand description
Yield points for improved cooperative scheduling.
Documentation for this can be found in the tokio::task
module.
Structs§
- Budget πOpaque type tracking the amount of βworkβ a task may still do before yielding back to the scheduler.
- BudgetDecrement π
- Coop πFuture wrapper to ensure cooperative scheduling.
- RestoreOnPending π
Functions§
- budget πRuns the given closure with a cooperative task budget. When the function returns, the budget is reset to the value prior to calling the function.
- cooperative πRun a future with a budget constraint for cooperative scheduling. If the future exceeds its budget while being polled, control is yielded back to the runtime.
- has_budget_remaining π
- poll_proceed πReturns
Poll::Pending
if the current task has exceeded its budget and should yield. - set πSets the current taskβs budget.
- stop πForcibly removes the budgeting constraints early.
- with_budget π
- with_unconstrained πRuns the given closure with an unconstrained task budget. When the function returns, the budget is reset to the value prior to calling the function.