Event-Driven Async
How slow agent work leaves the request path: the timers that decide sync, stream or job, the 202 job contract, at-least-once queues with leases and dead-letter routing, backpressure in queue age, and delivery by poll, SSE or webhook.
Last updated
After this section you can
- Choose sync, stream or job from the timers on the request path
- Configure a queue so a slow agent run is not executed twice
- Classify a failure and route it to retry, pause or the dead-letter queue
Event-Driven Async
Keep slow agent work off the request path: choose sync, stream or job, and run each job once in effect.
A request waits only as long as its shortest timer. Keep it synchronous when p95 is under about half that timer, stream it when a person is watching, and make anything longer a job: a 202 and a handle, then a queue.
Blue request, teal the API that accepts, purple state, amber the model, green the answer. Badges match the section’s steps 1 to 6. Pans sideways on a phone.