CandyWrite
HomeBlogs
CandyWrite

An independent publishing platform for essays on technology, design, and creative work. Free to read, free to write.

Explore

  • Home
  • All Blogs
  • Most Read
  • Most Liked

Get Updates

© 2026 CandyWrite Media Inc. All rights reserved.

Privacy PolicyTerms of Service
  1. Home
  2. Blogs
  3. AI & Engineering
  4. Streaming, Queues, and the Death of the Request-Response Mindset
AI & Engineering

Streaming, Queues, and the Death of the Request-Response Mindset

When work takes ninety seconds, HTTP request-response stops being an adequate model. The patterns that fix it are borrowed from job systems, not from web frameworks.

M
Muhammad Umer

29 August 2026•3 min read

0 views
Streaming, Queues, and the Death of the Request-Response Mindset

Web engineering spent twenty years assuming that a request finishes. Requests that take more than a few seconds were pathological, something to be optimised away. Then a category of features arrived where the work genuinely takes a minute or more, and the old shape started failing in familiar ways: gateway timeouts, duplicate work on retry, lost results when a user navigates away.

Separate accepting work from doing it

The correct shape is the one job systems have used forever. The request validates input, writes a task record, and returns an identifier immediately. A worker picks up the task and does the slow part. The client subscribes to progress. Nothing about this is novel; what is new is how many product features now need it.

Once you make this split, several problems solve themselves. Timeouts stop mattering. A user closing the tab no longer cancels the work. Retries become safe because the task row is the source of truth, and a second attempt updates the same record instead of starting a parallel one.

Choose your transport for the failure you can tolerate

  • Polling is the least elegant and the most robust. It survives proxies, mobile networks, and sleeping devices. Start here.
  • Server-sent events are ideal for one-directional token streams and degrade to reconnection cleanly.
  • WebSockets earn their complexity only when you need genuinely bidirectional, low-latency traffic.

A pattern that works well is streaming for the live experience plus a durable task record as the fallback, so a dropped connection means the user reloads and sees the finished result rather than losing it.

Idempotency is not optional

Any long operation will be retried, by your infrastructure, by an impatient user, or by a mobile client that lost its connection at second eighty-nine. Give every submission a client-generated key, store it, and make a repeat submission return the original task instead of starting a new one. Without this, the visible symptom is duplicate charges, duplicate emails, and duplicate records, and the invisible symptom is a bill you cannot explain.

Show the pipeline, not a spinner

An indeterminate spinner for ninety seconds reads as broken. A list of steps where each completes in sequence reads as work being done, even when the total time is identical. Name the steps in the user's language: reading the document, finding relevant sections, drafting, checking. Perceived speed is mostly a legibility problem.

Users forgive slow far more readily than they forgive uncertain. Progress that can be read is progress that can be waited on.

What to instrument

Track queue depth, time to first byte of useful output, total task duration at the ninety-fifth percentile, and abandonment rate by step. That last one is the product metric hiding inside an infrastructure dashboard: it tells you exactly where the wait became intolerable.

On this page
M

Written by Muhammad Umer

@umarrafique923

Author and writer at CandyWrite. Sharing knowledge, tutorials, and reflections on technology, design, and ideas.

Enjoyed this perspective?

Join 12,000+ readers getting our Saturday morning editorial dispatch with our top essays and reading recommendations.

Related articles

AI & Engineering

6 Sept 2026•4 min read

The React Compiler Ended the Memoization Debate. Now What?

AI & Engineering

3 Sept 2026•3 min read

Small Models, Big Systems: The Case for Routing Instead of Scaling

AI & Engineering

5 Sept 2026•4 min read

Retrieval Is a Data Problem, Not a Vector Problem

AI & Engineering

8 Sept 2026•5 min read

Agents Are Not Chatbots: What Changes When Software Takes Actions

Discussion (0)

Real-time updates enabled

Join the conversation. Sign in to leave a response or reply to comments.

Sign InCreate Account
No responses yet. Be the first to share your thoughts!