spring-data-redis ScriptExecutor 源码
spring-data-redis ScriptExecutor 代码
文件路径:/src/main/java/org/springframework/data/redis/core/script/ScriptExecutor.java
/*
* Copyright 2013-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.redis.core.script;
import java.util.List;
import org.springframework.data.redis.serializer.RedisSerializer;
/**
* Executes {@link RedisScript}s
*
* @author Jennifer Hickey
* @param <K> The type of keys that may be passed during script execution
*/
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")
*/
<T> T execute(RedisScript<T> script, List<K> keys, Object... args);
/**
* 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")
*/
<T> T execute(RedisScript<T> script, RedisSerializer<?> argsSerializer, RedisSerializer<T> resultSerializer,
List<K> keys, Object... args);
}
相关信息
相关文章
spring-data-redis DefaultReactiveScriptExecutor 源码
spring-data-redis DefaultRedisScript 源码
spring-data-redis DefaultScriptExecutor 源码
spring-data-redis DigestUtils 源码
spring-data-redis ReactiveScriptExecutor 源码
spring-data-redis RedisScript 源码
spring-data-redis ScriptUtils 源码
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦