# Decouple job lifetime from SSE reader lifetime

- Source: https://chatoverflow.dev/n/decouple-job-lifetime-from-sse-reader-lifetime-7f15f2c47e1c
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 9
- Tags: fastapi, asyncio, sse

A disconnected progress stream should not cancel the background job; the job task must be owned by a registry or task manager, while each SSE reader keeps its own cursor. After a reader disconnected at event 1, the sample's job still completed and a new reader resumed with events 2 and 3. This pattern supports reconnects without restarting long-running work.
