public <R> R await(RFuture<R> future) { final CountDownLatch l = new CountDownLatch(1); future.addListener(new FutureListener<R>() { @Override public void operationComplete(Future<R> future) throws Exception { l.countDown(); } }); try { if (!l.await(redisClient.getCommandTimeout(), TimeUnit.MILLISECONDS)) { RPromise<R> promise = (RPromise<R>)future; RedisTimeoutException ex = new RedisTimeoutException("Command execution timeout for " + redisClient.getAddr()); promise.tryFailure(ex); throw ex; } if (!future.isSuccess()) { if (future.cause() instanceof RedisException) { throw (RedisException) future.cause(); } throw new RedisException("Unexpected exception while processing command", future.cause()); } return future.getNow(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }
public <R> R await(RFuture<R> future) { final CountDownLatch l = new CountDownLatch(1); future.addListener(new FutureListener<R>() { @Override public void operationComplete(Future<R> future) throws Exception { l.countDown(); } }); try { if (!l.await(redisClient.getCommandTimeout(), TimeUnit.MILLISECONDS)) { RPromise<R> promise = (RPromise<R>)future; RedisTimeoutException ex = new RedisTimeoutException("Command execution timeout for " + redisClient.getAddr()); promise.tryFailure(ex); throw ex; } if (!future.isSuccess()) { if (future.cause() instanceof RedisException) { throw (RedisException) future.cause(); } throw new RedisException("Unexpected exception while processing command", future.cause()); } return future.getNow(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }
throw (Exception) rFuture.cause();
throw (Exception) rFuture.cause();
ackFuture.cancel(false); throw futureAdd.cause();
ackFuture.cancel(false); throw futureAdd.cause();
public <R> R await(RFuture<R> future) { final CountDownLatch l = new CountDownLatch(1); future.addListener(new FutureListener<R>() { @Override public void operationComplete(Future<R> future) throws Exception { l.countDown(); } }); try { if (!l.await(redisClient.getCommandTimeout(), TimeUnit.MILLISECONDS)) { RPromise<R> promise = (RPromise<R>)future; RedisTimeoutException ex = new RedisTimeoutException("Command execution timeout for " + redisClient.getAddr()); promise.tryFailure(ex); throw ex; } if (!future.isSuccess()) { if (future.cause() instanceof RedisException) { throw (RedisException) future.cause(); } throw new RedisException("Unexpected exception while processing command", future.cause()); } return future.getNow(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return null; } }
throw (Exception) rFuture.cause();
ackFuture.cancel(false); throw futureAdd.cause();