class documentation
class RedisStream(ReadableStream, SinakableStream): (source)
Undocumented
Async Method | read |
Reads a stream of data |
Async Method | sink |
Sinkes a record to a stream |
Class Variable | client |
Undocumented |
Class Variable | mappings |
Undocumented |
Class Variable | record |
Undocumented |
Class Variable | stream |
Undocumented |
Instance Variable | read |
Undocumented |
async def read(self, max_records:
int | None
= None, max_wait: float | None
= None) -> list[ dict]
:
(source)
¶
Reads a stream of data
```python stream = RedisStream(...)
records = await stream.read(max_records=10, max_wait=5) print(records[0]) ``` >>> {"passenger_id": 20, "age": 23, ...}
- Args:
- max_records (int, optional): _description_. Defaults to None. max_wait (float, optional): _description_. Defaults to None.
- Returns:
- list[dict]: A list of the records returned