@@ -429,6 +429,20 @@ public interface ReactiveRedisOperations<K, V> {
|
||||
return execute(script, keys, Collections.emptyList());
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the given {@link RedisScript}
|
||||
*
|
||||
* @param script The script to execute. Must not be {@literal null}.
|
||||
* @param keys keys that need to be passed to the script. Must not be {@literal null}.
|
||||
* @param args args that need to be passed to the script. Must not be {@literal null}.
|
||||
* @return result value of the script {@link Flux#empty()} if {@link RedisScript#getResultType()} is {@literal null},
|
||||
* likely indicating a throw-away status reply (i.e. "OK").
|
||||
* @since 3.4
|
||||
*/
|
||||
default <T> Flux<T> execute(RedisScript<T> script, List<K> keys, Object... args) {
|
||||
return execute(script, keys, Arrays.asList(args));
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the given {@link RedisScript}
|
||||
*
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.data.redis.core.script;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -30,8 +31,8 @@ import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
* <p>
|
||||
* Streams of methods returning {@code Mono<K>} or {@code Flux<M>} are terminated with
|
||||
* {@link org.springframework.dao.InvalidDataAccessApiUsageException} when
|
||||
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@code null} for a
|
||||
* particular element as Reactive Streams prohibit the usage of {@code null} values.
|
||||
* {@link org.springframework.data.redis.serializer.RedisElementReader#read(ByteBuffer)} returns {@literal null} for a
|
||||
* particular element as Reactive Streams prohibit the usage of {@literal null} values.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
@@ -67,8 +68,22 @@ public interface ReactiveScriptExecutor<K> {
|
||||
* Executes the given {@link RedisScript}
|
||||
*
|
||||
* @param script The script to execute. Must not be {@literal null}.
|
||||
* @param keys Any keys that need to be passed to the script. Must not be {@literal null}.
|
||||
* @param args Any args that need to be passed to the script. Can be {@literal empty}.
|
||||
* @param keys any keys that need to be passed to the script. Must not be {@literal null}.
|
||||
* @param args any args that need to be passed to the script. Can be {@literal empty}.
|
||||
* @return The return value of the script or {@link Flux#empty()} if {@link RedisScript#getResultType()} is
|
||||
* {@literal null}, likely indicating a throw-away status reply (i.e. "OK")
|
||||
* @since 3.4
|
||||
*/
|
||||
default <T> Flux<T> execute(RedisScript<T> script, List<K> keys, Object... args) {
|
||||
return execute(script, keys, Arrays.asList(args));
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the given {@link RedisScript}
|
||||
*
|
||||
* @param script The script to execute. Must not be {@literal null}.
|
||||
* @param keys any keys that need to be passed to the script. Must not be {@literal null}.
|
||||
* @param args any args that need to be passed to the script. Can be {@literal empty}.
|
||||
* @return The return value of the script or {@link Flux#empty()} if {@link RedisScript#getResultType()} is
|
||||
* {@literal null}, likely indicating a throw-away status reply (i.e. "OK")
|
||||
*/
|
||||
@@ -79,8 +94,8 @@ public interface ReactiveScriptExecutor<K> {
|
||||
* arguments and result.
|
||||
*
|
||||
* @param script The script to execute. must not be {@literal null}.
|
||||
* @param keys Any keys that need to be passed to the script
|
||||
* @param args Any args that need to be passed to the script
|
||||
* @param keys any keys that need to be passed to the script.
|
||||
* @param args any args that need to be passed to the script.
|
||||
* @param argsWriter The {@link RedisElementWriter} to use for serializing args. Must not be {@literal null}.
|
||||
* @param resultReader The {@link RedisElementReader} to use for serializing the script return value. Must not be
|
||||
* {@literal null}.
|
||||
|
||||
@@ -30,11 +30,11 @@ public interface ScriptExecutor<K> {
|
||||
/**
|
||||
* Executes the given {@link RedisScript}
|
||||
*
|
||||
* @param script The script to execute
|
||||
* @param keys Any keys that need to be passed to the script
|
||||
* @param args Any args that need to be passed to the script
|
||||
* @return The return value of the script or null if {@link RedisScript#getResultType()} is null, likely indicating a
|
||||
* throw-away status reply (i.e. "OK")
|
||||
* @param script the script to execute.
|
||||
* @param keys any keys that need to be passed to the script.
|
||||
* @param args any args that need to be passed to the script.
|
||||
* @return The return value of the script or {@literal null} if {@link RedisScript#getResultType()} is
|
||||
* {@literal null}, likely indicating a throw-away status reply (i.e. "OK")
|
||||
*/
|
||||
<T> T execute(RedisScript<T> script, List<K> keys, Object... args);
|
||||
|
||||
@@ -42,13 +42,13 @@ public interface ScriptExecutor<K> {
|
||||
* Executes the given {@link RedisScript}, using the provided {@link RedisSerializer}s to serialize the script
|
||||
* arguments and result.
|
||||
*
|
||||
* @param script The script to execute
|
||||
* @param argsSerializer The {@link RedisSerializer} to use for serializing args
|
||||
* @param resultSerializer The {@link RedisSerializer} to use for serializing the script return value
|
||||
* @param keys Any keys that need to be passed to the script
|
||||
* @param args Any args that need to be passed to the script
|
||||
* @return The return value of the script or null if {@link RedisScript#getResultType()} is null, likely indicating a
|
||||
* throw-away status reply (i.e. "OK")
|
||||
* @param script the script to execute.
|
||||
* @param argsSerializer The {@link RedisSerializer} to use for serializing args.
|
||||
* @param resultSerializer The {@link RedisSerializer} to use for serializing the script return value.
|
||||
* @param keys any keys that need to be passed to the script.
|
||||
* @param args any args that need to be passed to the script.
|
||||
* @return The return value of the script or {@literal null} if {@link RedisScript#getResultType()} is
|
||||
* {@literal null}, likely indicating a throw-away status reply (i.e. "OK")
|
||||
*/
|
||||
<T> T execute(RedisScript<T> script, RedisSerializer<?> argsSerializer, RedisSerializer<T> resultSerializer,
|
||||
List<K> keys, Object... args);
|
||||
|
||||
Reference in New Issue
Block a user