use of com.ctrip.xpipe.redis.core.protocal.RedisCommand in project x-pipe by ctripcorp.
the class TransactionalCommand method doWork.
@SuppressWarnings("unchecked")
protected void doWork(final SimpleObjectPool<NettyClient> clientPool) {
SequenceCommandChain chain = new SequenceCommandChain(false);
for (RedisCommand currentCommand : commands) {
OneTranscationCommand oneTranscationCommand = new OneTranscationCommand(clientPool, currentCommand, scheduled);
chain.add(oneTranscationCommand);
}
chain.execute().addListener(new CommandFutureListener() {
@Override
public void operationComplete(CommandFuture commandFuture) throws Exception {
if (!commandFuture.isSuccess()) {
logger.error("[doWork][fail]", commandFuture.cause());
}
endTranscation(clientPool);
}
});
}
Aggregations