Module tokio::runtime::coop

source ·
Expand description

Yield points for improved cooperative scheduling.

Documentation for this can be found in the tokio::task module.

Structs

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.
  • 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.
  • 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.