Closed
Description
Christoph Strobl opened DATAREDIS-1224 and commented
The LettuceCommands have repetitive code fragments within try - catch
blocks for differentiating between transaction
, pipeline
and normal command execution.
This can be simplified by using a RedisFuture
return connection.invoke(connection.getAsyncConnection().geodist(key, member1, member2, geoUnit), distanceConverter);
// ...
<S, T> T invoke(RedisFuture<S> future, Converter<S, T> converter) {
if (isPipelined()) {
pipeline(newLettuceResult(future, converter));
return null;
}
if (isQueueing()) {
transaction(newLettuceResult(future, converter));
return null;
}
return NullableResult.of((S) await(future)).convert(converter).get();
}
No further details from DATAREDIS-1224