tokio-task-supervisor
A wrapper around tokio_util::task::TaskTracker that adds coordinated shutdown via a shared cancellation token.
What it does
- Tracks running tasks (same as
TaskTracker) - Provides a shared
CancellationTokenfor shutdown - Spawns tasks that automatically get cancellation tokens
- Handles graceful shutdown (close tracker + cancel token + wait)
Usage
use TaskSupervisor;
use ;
async
API
spawn_with_token()- spawn task with cancellation tokenspawn_with_cancel()- spawn task that races against cancellationshutdown()- cancel all tasks and wait for completion
License
MIT