Redis Streams

class RedisStream(*, serializer, redis=None, host=None, port=None, db=None, redis_init_kwargs=None, logger=<RootLogger root (DEBUG)>)[source]

Bases: IStream

Parameters:
put(event, *, block=True, timeout=5)[source]

Put an event to stream

Parameters:
  • event (Event) – Event to put

  • block (bool) – Should I/O be blocked if some delay occurs. Defaults to True.

  • timeout (int) – Number of seconds to wait in case of latency. Defaults to 5.

Returns:

None

Return type:

None

pop(event, group, *, block=True, timeout=5)[source]

Pop an event from stream

Parameters:
  • event (EventType) – Event type

  • block (bool) – Should I/O be blocked if some delay occurs. Defaults to True.

  • timeout (int) – Number of seconds to wait in case of latency. Defaults to 5.

  • group (str | StrEnum | IntEnum)

Returns:

Next unprocessed event in stream

Return type:

Event