Expand description
Redis Stream consumer infrastructure for Pyra services.
Provides a generic StreamConsumer<H> that handles XREADGROUP, XACK, XCLAIM,
dead-lettering, and graceful shutdown. Services implement the StreamHandler
trait with their domain-specific processing logic.
Structs§
- Stream
Config - Configuration for a Redis Stream consumer.
- Stream
Consumer - A Redis Stream consumer that reads messages, dispatches them to a handler, and manages ACKs, retries (via XCLAIM), and dead-lettering.
Enums§
- Stream
Error - Errors that can occur in stream consumer operations.
Traits§
- Stream
Handler - Trait for handling messages from a Redis Stream.
Functions§
- as_
array - Extract an array from a Redis Value.
- as_
integer - Extract an integer from a Redis Value (handles both Int and BulkString representations).
- bulk_
str - Extract a bulk string value from a Redis Value.
- extract_
data_ field - Extract the value of the first field named “data” from a list of (key, value) pairs.
- parse_
claimed_ messages - Parse messages returned by XCLAIM into a list of (msg_id, fields) tuples.
- parse_
pending_ entries - Parse XPENDING response into (msg_id, consumer, idle_ms, delivery_count) tuples.
- parse_
stream_ response - Parse the response from XREADGROUP into a list of (msg_id, fields) tuples.
- release_
dedup_ lock - Release a dedup lock by deleting the key.
- try_
acquire_ dedup_ lock - Try to acquire a dedup lock using Redis SET NX EX.