refactoring

pull/6367/head
Nikita Koksharov 1 month ago
parent 133b15f13a
commit 68efa444c9

@ -48,7 +48,7 @@ public interface CommandAsyncExecutor {
CommandAsyncExecutor copy(boolean trackChanges);
RedissonObjectBuilder getObjectBuilder();
ConnectionManager getConnectionManager();
ServiceManager getServiceManager();
@ -62,7 +62,7 @@ public interface CommandAsyncExecutor {
<V> V get(RFuture<V> future);
<V> V get(CompletableFuture<V> future);
<V> V getInterrupted(RFuture<V> future) throws InterruptedException;
<V> V getInterrupted(CompletableFuture<V> future) throws InterruptedException;
@ -70,7 +70,7 @@ public interface CommandAsyncExecutor {
<T, R> RFuture<R> writeAsync(RedisClient client, Codec codec, RedisCommand<T> command, Object... params);
<T, R> RFuture<R> writeAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> command, Object... params);
<T, R> RFuture<R> writeAsync(byte[] key, Codec codec, RedisCommand<T> command, Object... params);
<T, R> RFuture<R> writeAsync(ByteBuf key, Codec codec, RedisCommand<T> command, Object... params);
@ -168,4 +168,9 @@ public interface CommandAsyncExecutor {
CommandBatchService createCommandBatchService(BatchOptions options);
}
static CommandAsyncExecutor create(ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder,
RedissonObjectBuilder.ReferenceType referenceType) {
return new CommandAsyncService(connectionManager, objectBuilder, referenceType);
}
}

@ -124,7 +124,7 @@ public class CommandAsyncService implements CommandAsyncExecutor {
this.trackChanges = false;
}
public CommandAsyncService(ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder,
protected CommandAsyncService(ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder,
RedissonObjectBuilder.ReferenceType referenceType) {
this.connectionManager = connectionManager;
this.objectBuilder = objectBuilder;

@ -568,6 +568,6 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
@Override
public CommandAsyncExecutor createCommandExecutor(RedissonObjectBuilder objectBuilder, RedissonObjectBuilder.ReferenceType referenceType) {
return new CommandAsyncService(this, objectBuilder, referenceType);
return CommandAsyncExecutor.create(this, objectBuilder, referenceType);
}
}

Loading…
Cancel
Save