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 Summary
Modifier and TypeMethodDescriptiondefault <T> reactor.core.publisher.Flux<T>execute(RedisScript<T> script) Execute the givenRedisScriptdefault <T> reactor.core.publisher.Flux<T>execute(RedisScript<T> script, List<K> keys) Execute the givenRedisScriptdefault <T> reactor.core.publisher.Flux<T>execute(RedisScript<T> script, List<K> keys, Object... args) Executes the givenRedisScript<T> reactor.core.publisher.Flux<T>execute(RedisScript<T> script, List<K> keys, List<?> args) Executes the givenRedisScript<T> reactor.core.publisher.Flux<T>execute(RedisScript<T> script, List<K> keys, List<?> args, RedisElementWriter<?> argsWriter, RedisElementReader<T> resultReader) Executes the givenRedisScript, using the providedRedisSerializers to serialize the script arguments and result.
-
Method Details
-
execute
Execute the givenRedisScript- Parameters:
script- must not be null.- Returns:
- the return value of the script or
Flux.empty()ifRedisScript.getResultType()is null, likely indicating a throw-away status reply (i.e. "OK")
-
execute
Execute the givenRedisScript- Parameters:
script- must not be null.keys- must not be null.- Returns:
- the return value of the script or
Flux.empty()ifRedisScript.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, Object... args) Executes the givenRedisScript- 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()ifRedisScript.getResultType()is null, likely indicating a throw-away status reply (i.e. "OK") - Since:
- 3.4
-
execute
Executes the givenRedisScript- 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()ifRedisScript.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 givenRedisScript, using the providedRedisSerializers 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- TheRedisElementWriterto use for serializing args. Must not be null.resultReader- TheRedisElementReaderto use for serializing the script return value. Must not be null.- Returns:
- The return value of the script or
Flux.empty()ifRedisScript.getResultType()is null, likely indicating a throw-away status reply (i.e. "OK")
-