public void sendNextCommand(Channel channel) { QueueCommand command = channel.attr(CommandsQueue.CURRENT_COMMAND).getAndSet(null); if (command != null) { queue.poll(); } else { QueueCommandHolder c = queue.peek(); if (c != null) { QueueCommand data = c.getCommand(); List<CommandData<Object, Object>> pubSubOps = data.getPubSubOperations(); if (!pubSubOps.isEmpty()) { queue.poll(); } } } sendData(channel); }
protected void sendNext(ChannelHandlerContext ctx, QueueCommand data) { if (data != null) { if (data.isExecuted()) { sendNext(ctx); } } else { sendNext(ctx); } }
public void sendNextCommand(Channel channel) { QueueCommand command = channel.attr(CommandsQueue.CURRENT_COMMAND).getAndSet(null); if (command != null) { queue.poll(); } else { QueueCommandHolder c = queue.peek(); if (c != null) { QueueCommand data = c.getCommand(); List<CommandData<Object, Object>> pubSubOps = data.getPubSubOperations(); if (!pubSubOps.isEmpty()) { queue.poll(); } } } sendData(channel); }
protected void sendNext(ChannelHandlerContext ctx, QueueCommand data) { if (data != null) { if (data.isExecuted()) { sendNext(ctx); } } else { sendNext(ctx); } }
private void sendData(Channel ch) { QueueCommandHolder command = queue.peek(); if (command != null && command.trySend()) { QueueCommand data = command.getCommand(); List<CommandData<Object, Object>> pubSubOps = data.getPubSubOperations(); if (!pubSubOps.isEmpty()) { for (CommandData<Object, Object> cd : pubSubOps) { for (Object channel : cd.getParams()) { ch.pipeline().get(CommandPubSubDecoder.class).addPubSubCommand((ChannelName) channel, cd); } } } else { ch.attr(CURRENT_COMMAND).set(data); } command.getChannelPromise().addListener(listener); ch.writeAndFlush(data, command.getChannelPromise()); } }
protected void sendNext(Channel channel, QueueCommand data) { if (data != null) { if (decoderStatus.get() == Status.FILL_BUFFER || data.isExecuted()) { sendNext(channel); } } else { sendNext(channel); } }
private void sendData(Channel ch) { QueueCommandHolder command = queue.peek(); if (command != null && command.trySend()) { QueueCommand data = command.getCommand(); List<CommandData<Object, Object>> pubSubOps = data.getPubSubOperations(); if (!pubSubOps.isEmpty()) { for (CommandData<Object, Object> cd : pubSubOps) { for (Object channel : cd.getParams()) { ch.pipeline().get(CommandPubSubDecoder.class).addPubSubCommand((ChannelName) channel, cd); } } } else { ch.attr(CURRENT_COMMAND).set(data); } command.getChannelPromise().addListener(listener); ch.writeAndFlush(data, command.getChannelPromise()); } }
public void sendNextCommand(Channel channel) { QueueCommand command = channel.attr(CommandsQueue.CURRENT_COMMAND).getAndSet(null); if (command != null) { queue.poll(); } else { QueueCommandHolder c = queue.peek(); if (c != null) { QueueCommand data = c.getCommand(); List<CommandData<Object, Object>> pubSubOps = data.getPubSubOperations(); if (!pubSubOps.isEmpty()) { queue.poll(); } } } sendData(channel); }
private void sendData(Channel ch) { QueueCommandHolder command = queue.peek(); if (command != null && command.trySend()) { QueueCommand data = command.getCommand(); List<CommandData<Object, Object>> pubSubOps = data.getPubSubOperations(); if (!pubSubOps.isEmpty()) { for (CommandData<Object, Object> cd : pubSubOps) { for (Object channel : cd.getParams()) { ch.pipeline().get(CommandPubSubDecoder.class).addPubSubCommand((ChannelName) channel, cd); } } } else { ch.attr(CURRENT_COMMAND).set(data); } command.getChannelPromise().addListener(listener); ch.writeAndFlush(data, command.getChannelPromise()); } }