Interface ReactiveScriptExecutor<K>

Type Parameters:
K - The type of keys that may be passed during script execution
All Known Implementing Classes:
DefaultReactiveScriptExecutor

public interface ReactiveScriptExecutor<K>
Executes RedisScripts using reactive infrastructure.

Streams of methods returning Mono<K> or Flux<M> are terminated with InvalidDataAccessApiUsageException when RedisElementReader.read(ByteBuffer) returns null for a particular element as Reactive Streams prohibit the usage of null values.

Since:
2.0
Author:
Mark Paluch, Christoph Strobl
  • Method Details

    • execute

      default <T> reactor.core.publisher.Flux<T> execute(RedisScript<T> script)
      Execute the given RedisScript
      Parameters:
      script - must not be null.
      Returns:
      the return value of the script or Flux.empty() if RedisScript.getResultType() is null, likely indicating a throw-away status reply (i.e. "OK")
    • execute

      default <T> reactor.core.publisher.Flux<T> execute(RedisScript<T> script, List<K> keys)
      Execute the given RedisScript
      Parameters:
      script - must not be null.
      keys - must not be null.
      Returns:
      the return value of the script or Flux.empty() if RedisScript.getResultType() is null, likely indicating a throw-away status reply (i.e. "OK")
    • execute

      <T> reactor.core.publisher.Flux<T> execute(RedisScript<T> script, List<K> keys, List<?> args)
      Executes the given RedisScript
      Parameters:
      script - The script to execute. Must not be null.
      keys - Any keys that need to be passed to the script. Must not be null.
      args - Any args that need to be passed to the script. Can be empty.
      Returns:
      The return value of the script or Flux.empty() if RedisScript.getResultType() is null, likely indicating a throw-away status reply (i.e. "OK")
    • execute

      <T> reactor.core.publisher.Flux<T> execute(RedisScript<T> script, List<K> keys, List<?> args, RedisElementWriter<?> argsWriter, RedisElementReader<T> resultReader)
      Executes the given RedisScript, using the provided RedisSerializers to serialize the script arguments and result.
      Parameters:
      script - The script to execute. must not be null.
      keys - Any keys that need to be passed to the script
      args - Any args that need to be passed to the script
      argsWriter - The RedisElementWriter to use for serializing args. Must not be null.
      resultReader - The RedisElementReader to use for serializing the script return value. Must not be null.
      Returns:
      The return value of the script or Flux.empty() if RedisScript.getResultType() is null, likely indicating a throw-away status reply (i.e. "OK")