StreamSub
faststream.redis.StreamSub #
StreamSub(
stream: str,
polling_interval: int | None = None,
group: str | None = None,
consumer: str | None = None,
batch: bool = False,
no_ack: bool = False,
last_id: str | None = None,
maxlen: int | None = None,
max_records: int | None = None,
min_idle_time: int | None = None,
)
Bases: NameRequired
A class to represent a Redis Stream subscriber.
| PARAMETER | DESCRIPTION |
|---|---|
batch | Whether to consume messages in batches or not. TYPE: |
max_records | Number of messages to consume as one batch. TYPE: |
consumer | The consumer unique name https://redis.io/docs/latest/develop/tools/insight/tutorials/insight-stream-consumer/#run-the-consumer TYPE: |
group | The name of consumer group TYPE: |
last_id | An Entry ID, which uses to pick up from where it left off after it is restarted. TYPE: |
maxlen | Redis Stream maxlen publish option. Remove eldest message if maxlen exceeded. https://redis.io/docs/latest/develop/data-types/streams/#capped-streams TYPE: |
name | The original Redis Stream name.
|
no_ack | If True, to enable the XREADGROUP NOACK subcommand. https://redis.io/docs/latest/commands/xreadgroup/#differences-between-xread-and-xreadgroup TYPE: |
polling_interval | Polling interval in seconds. TYPE: |
min_idle_time | Minimum idle time in milliseconds for a message to be eligible for claiming via XAUTOCLAIM. Messages that have been pending (unacknowledged) for at least this duration can be reclaimed by this consumer. Only applicable when using consumer groups. https://redis.io/docs/latest/commands/xautoclaim/ TYPE: |