Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita committed Nov 25, 2016
1 parent 922d5b8 commit 72c9afe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
Expand Up @@ -171,7 +171,7 @@ protected RFuture<Long> pushTaskAsync() {
+ "end " + "end "
+ "return nil;", + "return nil;",
Arrays.<Object>asList(requestQueueName, schedulerQueueName, schedulerTasksName), Arrays.<Object>asList(requestQueueName, schedulerQueueName, schedulerTasksName),
System.currentTimeMillis(), 10); System.currentTimeMillis(), 100);
} }
}; };
scheduler.start(); scheduler.start();
Expand Down
Expand Up @@ -36,7 +36,6 @@
import io.netty.util.AttributeKey; import io.netty.util.AttributeKey;
import io.netty.util.concurrent.Future; import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.FutureListener; import io.netty.util.concurrent.FutureListener;
import io.netty.util.concurrent.Promise;
import io.netty.util.concurrent.ScheduledFuture; import io.netty.util.concurrent.ScheduledFuture;


public class RedisConnection implements RedisCommands { public class RedisConnection implements RedisCommands {
Expand All @@ -52,8 +51,6 @@ public class RedisConnection implements RedisCommands {
private ReconnectListener reconnectListener; private ReconnectListener reconnectListener;
private long lastUsageTime; private long lastUsageTime;


private final RFuture<?> acquireFuture = RedissonPromise.newSucceededFuture(this);

public RedisConnection(RedisClient redisClient, Channel channel) { public RedisConnection(RedisClient redisClient, Channel channel) {
super(); super();
this.redisClient = redisClient; this.redisClient = redisClient;
Expand Down Expand Up @@ -246,10 +243,6 @@ public String toString() {
return getClass().getSimpleName() + "@" + System.identityHashCode(this) + " [redisClient=" + redisClient + ", channel=" + channel + "]"; return getClass().getSimpleName() + "@" + System.identityHashCode(this) + " [redisClient=" + redisClient + ", channel=" + channel + "]";
} }


public RFuture<?> getAcquireFuture() {
return acquireFuture;
}

public void onDisconnect() { public void onDisconnect() {
} }


Expand Down
Expand Up @@ -329,15 +329,15 @@ private void decodeList(ByteBuf in, CommandData<Object, Object> data, List<Objec
// store current message index // store current message index
checkpoint(); checkpoint();


handleMultiResult(data, null, channel, result); handlePublishSubscribe(data, null, channel, result);
// has next messages? // has next messages?
if (in.writerIndex() > in.readerIndex()) { if (in.writerIndex() > in.readerIndex()) {
decode(in, data, null, channel); decode(in, data, null, channel);
} }
} }
} }


private void handleMultiResult(CommandData<Object, Object> data, List<Object> parts, private void handlePublishSubscribe(CommandData<Object, Object> data, List<Object> parts,
Channel channel, final Object result) { Channel channel, final Object result) {
if (result instanceof PubSubStatusMessage) { if (result instanceof PubSubStatusMessage) {
String channelName = ((PubSubStatusMessage) result).getChannel(); String channelName = ((PubSubStatusMessage) result).getChannel();
Expand Down

0 comments on commit 72c9afe

Please sign in to comment.