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§

  • 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.
  • 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 πŸ”’
  • 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.