Skip to main content
Swytch Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Streams

Keep an ordered sequence of events and track which work a consumer group has acknowledged.

XGROUP CREATE jobs:images workers 0 MKSTREAM
XADD jobs:images * job resize:42
XREADGROUP GROUP workers worker-1 COUNT 1 STREAMS jobs:images >

The group-creation command is a one-time setup step. After processing the returned entry, acknowledge its actual ID:

XACK jobs:images workers RETURNED_ENTRY_ID

Recover abandoned work

Inspect pending entries with XPENDING. Use XCLAIM or XAUTOCLAIM to transfer work from failed consumers, with a timeout appropriate to the job duration. A slow consumer can still be executing a job when it is reclaimed, so make external effects idempotent.

Acknowledgement tracks processing; it does not delete the stream entry. Plan retention with XTRIM or XDEL, and avoid removing entries that consumers still need.

Choose tiered storage if pending work must survive loss of all in-memory holders. See stream commands and queue patterns for the delivery boundary.