Interface RedisTransactionalClient<A,B>

Type Parameters:
A - key type
B - value type
All Superinterfaces:
RedisClient<A,B>, RedisGeoReactiveOperations<A,B>, RedisHashReactiveOperations<A,B>, RedisHLLReactiveOperations<A,B>, RedisKeyReactiveOperations<A,B>, RedisListReactiveOperations<A,B>, RedisOperations<A,B>, RedisScriptingReactiveOperations<A,B>, RedisSetReactiveOperations<A,B>, RedisSortedSetReactiveOperations<A,B>, RedisStreamReactiveOperations<A,B>, RedisStringReactiveOperations<A,B>
All Known Implementing Classes:
PoolRedisClient

public interface RedisTransactionalClient<A,B> extends RedisClient<A,B>

A Redis Client exposes reactive method to query a Redis datastore with transaction support.

Since:
1.4
Author:
Jeremy Kuhn
  • Method Details

    • multi

      Mono<RedisTransactionalOperations<A,B>> multi(A... watches)

      Starts a transaction block with the specified watches.

      All Redis operations performed within the function using the Redis operations argument will be executed on a single connection.

      The connection is obtained and the transaction started when the returned publisher is subscribed. The transaction MUST be explicitly executed or discarded in order to free resources.

      Whether connections are reused (pool) or created is implementation specific.

      Parameters:
      watches - a list of watches
      Returns:
      a mono emitting a transactional operations object
    • multi

      Executes queries in a transaction on a single connection.

      The specified function shall return queries publishers created from the Redis operations argument, these queries are then executed within a transaction on a single Redis connection.

      The connection is obtained and the transaction started when the returned publisher is subscribed. The transaction is executed when the returned operations publisher successfully completes or discarded when it completes with errors. The connection is eventually closed once the EXEX/DISCARD operation terminates.

      Whether connections are reused (pool) or created is implementation specific.

      Parameters:
      function - a function returning queries to execute in a transaction
      watches - a list of watches
      Returns:
      a mono emitting transaction result