recall

← recall

long polling pattern

Client opens a request and the server keeps it open until data is ready (or a timeout). Trades a long-lived connection for near-instant delivery without a real push channel.

Client opens a request and the server keeps it open until data is ready (or a timeout). Trades a long-lived connection for near-instant delivery without a real push channel.

symptoms

  • many idle connections
  • load balancer / proxy timeouts dropping requests

causes

  • need low-latency delivery without WebSocket / SSE infrastructure

fixes

  • set timeouts shorter than infra timeouts
  • client reconnects immediately on response
  • consider SSE or WebSocket if scale matters

you might say

  • long-poll for new jobs
  • hold the connection open

related

topics: api-design

references: