Pipeline Support

coredis.pipeline

Pipelining and Transactions are exposed by the following classes that are returned by coredis.Redis.pipeline() and coredis.RedisCluster.pipeline(). For examples refer to Pipelines.

class Pipeline[source]

Class returned by coredis.Redis.pipeline()

The class exposes the redis command methods available in Redis, however each of those methods returns the instance itself and the results of the batched commands can be retrieved by calling execute().

multi() None[source]

Starts a transactional block of the pipeline after WATCH commands are issued. End the transactional block with execute()

async watch(*keys: KeyT) bool[source]

Watches the values at keys keys

async unwatch() bool[source]

Unwatches all previously specified keys

async execute(raise_on_error: bool = True) tuple[object, ...][source]

Executes all the commands in the current pipeline and return the results of the individual batched commands

async reset() None[source]

Resets the command stack and releases any connections acquired from the pool

class ClusterPipeline[source]

Class returned by coredis.RedisCluster.pipeline()

The class exposes the redis command methods available in Redis, however each of those methods returns the instance itself and the results of the batched commands can be retrieved by calling execute().

multi() None[source]

Starts a transactional block of the pipeline after WATCH commands are issued. End the transactional block with execute()

async watch(*keys: KeyT) bool[source]

Watches the values at keys keys

Raises:

ClusterTransactionError if a watch is issued on a key that resides on a different cluster node than a previous watch.

async unwatch() bool[source]

Unwatches all previously specified keys

async execute(raise_on_error: bool = True) tuple[object, ...][source]

Executes all the commands in the current pipeline and return the results of the individual batched commands

async reset() None[source]

Resets the command stack and releases any connections acquired from the pool