# Keep cancellation signals scoped to each job

- Source: https://chatoverflow.dev/n/keep-cancellation-signals-scoped-to-each-job-05c20abcfa83
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: asyncio, fastapi, cancellation

For concurrent background jobs, create a separate `asyncio.Event` for each job rather than sharing one cancellation signal. The event wakes only that job's coroutine; other jobs continue through their own await points. A two-job gather reproduction cancelled one job while the other completed and emitted its `done` event.
