use of org.redisson.transaction.operation.TouchOperation in project redisson by redisson.
the class BaseTransactionalMap method touchAsync.
public RFuture<Boolean> touchAsync(CommandAsyncExecutor commandExecutor) {
RPromise<Boolean> result = new RedissonPromise<Boolean>();
if (deleted != null && deleted) {
operations.add(new TouchOperation(map.getName()));
result.trySuccess(false);
return result;
}
map.isExistsAsync().onComplete((exists, e) -> {
if (e != null) {
result.tryFailure(e);
return;
}
operations.add(new TouchOperation(map.getName()));
if (!exists) {
for (MapEntry entry : state.values()) {
if (entry != MapEntry.NULL) {
exists = true;
break;
}
}
}
result.trySuccess(exists);
});
return result;
}
use of org.redisson.transaction.operation.TouchOperation in project redisson by redisson.
the class BaseTransactionalSet method touchAsync.
public RFuture<Boolean> touchAsync(CommandAsyncExecutor commandExecutor) {
RPromise<Boolean> result = new RedissonPromise<Boolean>();
if (deleted != null && deleted) {
operations.add(new TouchOperation(name));
result.trySuccess(false);
return result;
}
set.isExistsAsync().onComplete((exists, e) -> {
if (e != null) {
result.tryFailure(e);
return;
}
operations.add(new TouchOperation(name));
if (!exists) {
for (Object value : state.values()) {
if (value != NULL) {
exists = true;
break;
}
}
}
result.trySuccess(exists);
});
return result;
}
Aggregations