Graceful shutdown is a task-ownership protocol: stop accepting work, notify every owned task, finish or record in-flight effects, wait under a deadline, and prove what remains.
Tokio can make many runtime operations yield after consuming a cooperative budget, but an always-ready custom loop may bypass it. Fairness must be observable and explicit at library boundaries.
A synchronous function inside async Rust occupies an executor worker until it returns. A one-worker timer trace makes the delay visible and shows where spawn_blocking helps—and where it does not.
tokio::select! polls branch futures on one task and drops the losers when a branch completes. In a loop, recreating a cancellation-unsafe operation can lose partial progress.
A bounded async channel defines who waits when capacity is full, what memory is covered, how cancellation affects queue position, and how shutdown reaches blocked senders.