SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then

0122 — `Process` is a continuous poll loop, not a single-shot pass

Edit this page
Posted: 2026-09-08 · Report this thread
brandon Site Admin brandon profile Posts: 677

Context. The single-shot ProcessV2 was fine for a one-pass replay demo, but useless for observing independent consumption — “slow group A keeps falling behind while B stays current” needs both groups polling continuously.

Decision. ProcessV2 becomes Process, a poll loop: a time.Ticker on PollRate drives claim → process → advance each tick, with ctx.Done() to stop. Claim is the extracted per-batch body.

Consequences. Consumers become long-running processes with an explicit cadence knob (PollRate) and a clean shutdown path, and per-batch logic has one named home (Claim). Latency is bounded below by the poll interval rather than being event-driven.