//
Future<Response> pendingResponse = queueRequest(cmd, args);
// wait for response
//
Response response;
try {
// This will block.
response = pendingResponse.get();
}
catch (InterruptedException e) {
e.printStackTrace();
throw new ClientRuntimeException("on pendingResponse.get()", e);
}
catch (ExecutionException e) {
if(e.getCause() instanceof RedisException) {
throw (RedisException) e.getCause();
}
else {
e.printStackTrace();
throw new ProviderException("on pendingResponse.get()", e);
}
}
// check response status
//
ResponseStatus status = Assert.notNull (response.getStatus(), "status from response object", ProviderException.class);
if(status.isError()) {
Log.error ("Error response for " + cmd.code + " => " + status.message());
throw new RedisException(cmd, status.message());
}
/* this is handled by the super class */