StreamSub
faststream.redis.StreamSub #
StreamSub(stream: str, polling_interval: Optional[PositiveInt] = 100, group: Optional[str] = None, consumer: Optional[str] = None, batch: bool = False, no_ack: bool = False, last_id: Optional[str] = None, maxlen: Optional[PositiveInt] = None, max_records: Optional[PositiveInt] = None)
Bases: NameRequired
A class to represent a Redis Stream subscriber.
Redis Stream subscriber parameters.
PARAMETER | DESCRIPTION |
---|---|
stream | (str): Redis Stream name. TYPE: |
polling_interval | (int:ms | None): wait message block. TYPE: |
group | (str | None): consumer group name. |
consumer | (str | None): consumer name. |
batch | (bool): consume messages in batches. TYPE: |
max_records | (int | None): consuming batch size. TYPE: |
no_ack | (bool): do not add message to PEL. TYPE: |
last_id | (str | None): start reading from this ID. |
maxlen | (int | None): truncate old stream members beyond this size. TYPE: |
Source code in faststream/redis/schemas.py
polling_interval class-attribute
instance-attribute
#
polling_interval: Optional[PositiveInt] = Field(default=100, description='ms')
validate classmethod
#
Validates a value.
PARAMETER | DESCRIPTION |
---|---|
value | The value to be validated. |
**kwargs | Additional keyword arguments. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[NameRequiredCls] | The validated value. |