Connections & protocols

Long polling

Long polling keeps an HTTP request open until new data is available or a timeout occurs, after which the client makes another request.

Also found under: HTTP long poll

How it works

Unlike periodic polling, the server can respond as soon as an update arrives during an outstanding request. Each completed response still needs a new request, and applications must handle timeout and retry behavior. It is a different transport strategy from an ongoing WebSocket connection.

In a Pubb integration

Pubb documents WebSocket subscriptions and HTTP publishing. Do not assume a long-polling subscriber fallback exists; implement an application-specific refresh path if your environment requires one.

Connect a client

A practical example

A client asks for changes and waits for the server's response. After receiving an update, it immediately opens the next request so later changes can be detected.