polling

Having the client ask repeatedly, on its own schedule, whether something has changed or finished.

In more detail

Polling is simple and easy to retry, and it works when the client cannot receive inbound calls. It costs repeated requests when nothing changed, so use a sensible interval, backoff and a cursor. Webhooks and streams push changes instead.

Examples

In the browser: Polling the DOM every few milliseconds wastes CPU and still reacts late. Observers such as MutationObserver notify you only when something actually happens.
The outbox relay polls for unsent rows; web-first assertions poll the page.
select {
case value := <-updates:
	fmt.Println(value)
default:
	fmt.Println("no update")
}
Go: a select with a default case polls a channel once

Related terms

Taught in

References

Certification courses