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
RedisScript
s 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 givenRedisScript
default <T> reactor.core.publisher.Flux<T>
execute
(RedisScript<T> script, List<K> keys) Execute 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 providedRedisSerializer
s 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
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 providedRedisSerializer
s 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 scriptargs
- Any args that need to be passed to the scriptargsWriter
- TheRedisElementWriter
to use for serializing args. Must not be null.resultReader
- TheRedisElementReader
to 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")
-