Interface ScriptExecutor<K>
- Type Parameters:
K- The type of keys that may be passed during script execution
- All Known Implementing Classes:
DefaultScriptExecutor
-
Method Summary
Modifier and TypeMethodDescription<T extends @Nullable Object>
Texecute(@NonNull RedisScript<T> script, @NonNull List<@NonNull K> keys, @NonNull Object @NonNull ... args) Executes the givenRedisScript<T extends @Nullable Object>
Texecute(@NonNull RedisScript<T> script, @NonNull RedisSerializer<?> argsSerializer, @NonNull RedisSerializer<T> resultSerializer, @NonNull List<@NonNull K> keys, @NonNull Object... args) Executes the givenRedisScript, using the providedRedisSerializers to serialize the script arguments and result.
-
Method Details
-
execute
<T extends @Nullable Object> T execute(@NonNull RedisScript<T> script, @NonNull List<@NonNull K> keys, @NonNull Object @NonNull ... args) Executes the givenRedisScript- Parameters:
script- the script to execute.keys- any keys that need to be passed to the script.args- any args that need to be passed to the script.- Returns:
- The return value of the script or null if
RedisScript.getResultType()is null, likely indicating a throw-away status reply (i.e. "OK")
-
execute
<T extends @Nullable Object> T execute(@NonNull RedisScript<T> script, @NonNull RedisSerializer<?> argsSerializer, @NonNull RedisSerializer<T> resultSerializer, @NonNull List<@NonNull K> keys, @NonNull Object... args) Executes the givenRedisScript, using the providedRedisSerializers to serialize the script arguments and result.- Parameters:
script- the script to execute.argsSerializer- TheRedisSerializerto use for serializing args.resultSerializer- TheRedisSerializerto use for serializing the script return value.keys- any keys that need to be passed to the script.args- any args that need to be passed to the script.- Returns:
- The return value of the script or null if
RedisScript.getResultType()is null, likely indicating a throw-away status reply (i.e. "OK")
-