Skip to main content

Crate pyra_streams

Crate pyra_streams 

Source
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§

StreamConfig
Configuration for a Redis Stream consumer.
StreamConsumer
A Redis Stream consumer that reads messages, dispatches them to a handler, and manages ACKs, retries (via XCLAIM), and dead-lettering.

Enums§

StreamError
Errors that can occur in stream consumer operations.

Traits§

StreamHandler
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.

Type Aliases§

StreamResult