io.quarkus.redis.runtime.datasource.ReactiveStringCommandsImpl 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 java.lang.reflect.Type;
import java.util.Map;
import io.quarkus.redis.datasource.ReactiveRedisDataSource;
import io.quarkus.redis.datasource.string.GetExArgs;
import io.quarkus.redis.datasource.string.ReactiveStringCommands;
import io.quarkus.redis.datasource.string.SetArgs;
import io.quarkus.redis.datasource.value.ReactiveValueCommands;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Response;
public class ReactiveStringCommandsImpl extends AbstractStringCommands
implements ReactiveStringCommands, ReactiveValueCommands {
private final ReactiveRedisDataSource reactive;
public ReactiveStringCommandsImpl(ReactiveRedisDataSourceImpl redis, Type k, Type v) {
super(redis, k, v);
this.reactive = redis;
}
@Override
public ReactiveRedisDataSource getDataSource() {
return reactive;
}
@Override
public Uni set(K key, V value) {
return super._set(key, value)
.replaceWithVoid();
}
@Override
public Uni set(K key, V value, SetArgs setArgs) {
return super._set(key, value, setArgs)
.replaceWithVoid();
}
@Override
public Uni set(K key, V value, io.quarkus.redis.datasource.value.SetArgs setArgs) {
return super._set(key, value, setArgs)
.replaceWithVoid();
}
@Override
public Uni setGet(K key, V value) {
return super._setGet(key, value)
.map(this::decodeV);
}
@Override
public Uni setGet(K key, V value, SetArgs setArgs) {
return super._setGet(key, value, setArgs)
.map(this::decodeV);
}
@Override
public Uni setGet(K key, V value, io.quarkus.redis.datasource.value.SetArgs setArgs) {
return super._setGet(key, value, setArgs)
.map(this::decodeV);
}
@Override
public Uni setex(K key, long seconds, V value) {
return super._setex(key, seconds, value)
.replaceWithVoid();
}
@Override
public Uni psetex(K key, long milliseconds, V value) {
return super._psetex(key, milliseconds, value)
.replaceWithVoid();
}
@Override
public Uni setnx(K key, V value) {
return super._setnx(key, value)
.map(Response::toBoolean);
}
@Override
public Uni setrange(K key, long offset, V value) {
return super._setrange(key, offset, value)
.map(Response::toLong);
}
@Override
public Uni strlen(K key) {
return super._strlen(key)
.map(Response::toLong);
}
@Override
public Uni decr(K key) {
return super._decr(key)
.map(Response::toLong);
}
@Override
public Uni decrby(K key, long amount) {
return super._decrby(key, amount)
.map(Response::toLong);
}
@Override
public Uni get(K key) {
return super._get(key)
.map(this::decodeV);
}
@Override
public Uni getdel(K key) {
return super._getdel(key)
.map(this::decodeV);
}
@Override
public Uni getex(K key, GetExArgs args) {
return super._getex(key, args)
.map(this::decodeV);
}
@Override
public Uni getex(K key, io.quarkus.redis.datasource.value.GetExArgs args) {
return super._getex(key, args)
.map(this::decodeV);
}
@Override
public Uni getrange(K key, long start, long end) {
return super._getrange(key, start, end)
.map(Response::toString);
}
@Override
public Uni getset(K key, V value) {
return super._getset(key, value)
.map(this::decodeV);
}
@Override
public Uni incr(K key) {
return super._incr(key)
.map(Response::toLong);
}
@Override
public Uni incrby(K key, long amount) {
return super._incrby(key, amount)
.map(Response::toLong);
}
@Override
public Uni incrbyfloat(K key, double amount) {
return super._incrbyfloat(key, amount)
.map(Response::toDouble);
}
@Override
public Uni append(K key, V value) {
return super._append(key, value)
.map(Response::toLong);
}
@Override
public Uni
© 2015 - 2025 Weber Informatics LLC | Privacy Policy