bec_lib.connector.StoreInterface#

class StoreInterface(store)[source]#

Bases: ABC

StoreBase defines the interface for storing data

Methods

delete

Delete a key

execute_pipeline

Execute a pipeline

get

Get a value

keys

Get keys that match the pattern

lpush

Push a message to the left of the list

lrange

Get a range of values from the list

lset

Set a value in the list at the given index

pipeline

Create a pipeline for batch operations

rpush

Push a message to the right of the list

set

Set a value

xadd

Add a message to the stream

xrange

Read from the stream

xread

Read from the stream

abstract delete(topic, pipe=None)[source]#

Delete a key

abstract execute_pipeline(pipeline)[source]#

Execute a pipeline

abstract get(topic: str, pipe=None)[source]#

Get a value

abstract keys(pattern: str) list[source]#

Get keys that match the pattern

abstract lpush(topic: str, msg: str, pipe=None, max_size: int | None = None, expire: int | None = None) None[source]#

Push a message to the left of the list

abstract lrange(topic: str, start: int, end: int, pipe=None)[source]#

Get a range of values from the list

abstract lset(topic: str, index: int, msg: str, pipe=None) None[source]#

Set a value in the list at the given index

abstract pipeline()[source]#

Create a pipeline for batch operations

abstract rpush(topic: str, msg: str, pipe=None) int[source]#

Push a message to the right of the list

abstract set(topic: str, msg, pipe=None, expire: int | None = None) None[source]#

Set a value

abstract xadd(topic: str, msg_dict: dict, max_size=None, pipe=None, expire: int | None = None)[source]#

Add a message to the stream

abstract xrange(topic: str, min: str, max: str, count: int | None = None, pipe=None)[source]#

Read from the stream

abstract xread(topic: str, id: str | None = None, count: int | None = None, block: int | None = None, pipe=None, from_start=False) list[source]#

Read from the stream