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.
- Budget
Decrement π - Coop πFuture wrapper to ensure cooperative scheduling.
- Restore
OnPending π
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 πReturnsPoll::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.