JoobQ::RedisEventSink
Inherits JoobQ::EventSink < Reference < Object
Persists events in a capped Redis Stream (replayable by id) and publishes them on a pub/sub channel for live consumers. Delivery is batched: one pipelined round trip appends to the stream, a second publishes the batch.
Constants
The stream is never trimmed below this many entries, whatever they weigh.
Constructors
Class methods
The most memory the stream may use, in bytes (JOOBQ_EVENTS_MAX_BYTES; 0 turns the limit off, as does a negative number). A value that is not a whole number is ignored with a warning.
Drops the oldest entries when the stream uses more memory than budget; returns how many it dropped.
MAXLEN bounds the count only, and events with big payloads can make 50 000 entries very heavy. Only one
process checks per lock period (the lock is a throttle, not held during the trim), and the stream is trimmed to 90 % of the budget so it does not trim on every beat.
Instance methods
Sinks that can deliver in bulk (e.g. one pipelined round trip) override this.