io.quarkus.redis.runtime.datasource.ReactiveHashCommandsImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-redis-client Show documentation
Show all versions of quarkus-redis-client Show documentation
Connect to Redis in either imperative or reactive style
package io.quarkus.redis.runtime.datasource;
import static io.smallrye.mutiny.helpers.ParameterValidation.nonNull;
import java.lang.reflect.Type;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import io.quarkus.redis.datasource.ReactiveRedisDataSource;
import io.quarkus.redis.datasource.ScanArgs;
import io.quarkus.redis.datasource.hash.ReactiveHashCommands;
import io.quarkus.redis.datasource.hash.ReactiveHashScanCursor;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Response;
public class ReactiveHashCommandsImpl extends AbstractHashCommands implements ReactiveHashCommands {
private final ReactiveRedisDataSource reactive;
public ReactiveHashCommandsImpl(ReactiveRedisDataSourceImpl redis, Type k, Type f, Type v) {
super(redis, k, f, v);
this.reactive = redis;
}
@Override
public ReactiveRedisDataSource getDataSource() {
return reactive;
}
@SafeVarargs
@Override
public final Uni hdel(K key, F... fields) {
return super._hdel(key, fields)
.map(Response::toInteger);
}
@Override
public Uni hexists(K key, F field) {
return super._hexists(key, field)
.map(Response::toBoolean);
}
@Override
public Uni hget(K key, F field) {
return super._hget(key, field)
.map(this::decodeV);
}
@Override
public Uni hincrby(K key, F field, long amount) {
return super._hincrby(key, field, amount)
.map(Response::toLong);
}
@Override
public Uni hincrbyfloat(K key, F field, double amount) {
return super._hincrbyfloat(key, field, amount)
.map(Response::toDouble);
}
@Override
public Uni
© 2015 - 2025 Weber Informatics LLC | Privacy Policy