pythia.event_stream.redis#

Redis-backed event stream storage.

class pythia.event_stream.redis.Backend(uri: str)[source]#

Bases: Backend

Simple backend to post messages using Redis.xadd().

Initialize a backend from its uri.

Parameters:

uri – connection string.

_abc_impl = <_abc_data object>#
_client: Redis | None = None#
property client: Redis#

Redis producer lazy-loader.

Returns:

Initialized producer, guaranteed to be both ping-connected.

connect() None[source]#

Instantiate a Redis client.

This method is in charge of creating the client and making sure it is properly connected via ping.

post(data) None[source]#

Make the redis client send data via Redis.xadd().

Parameters:

data – the data to append. Can be any python object.