io.quarkus.redis.runtime.datasource.ReactiveGraphCommandsImpl 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.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import io.quarkus.redis.datasource.ReactiveRedisCommands;
import io.quarkus.redis.datasource.ReactiveRedisDataSource;
import io.quarkus.redis.datasource.graph.GraphQueryResponseItem;
import io.quarkus.redis.datasource.graph.ReactiveGraphCommands;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Response;
import io.vertx.redis.client.ResponseType;
public class ReactiveGraphCommandsImpl extends AbstractGraphCommands
implements ReactiveGraphCommands, ReactiveRedisCommands {
private final ReactiveRedisDataSource reactive;
protected final Class typeOfKey;
public ReactiveGraphCommandsImpl(ReactiveRedisDataSourceImpl redis, Class k) {
super(redis, k);
this.typeOfKey = k;
this.reactive = redis;
}
@Override
public ReactiveRedisDataSource getDataSource() {
return reactive;
}
@Override
public Uni graphDelete(K key) {
return super._graphDelete(key)
.replaceWithVoid();
}
@Override
public Uni graphExplain(K key, String query) {
return super._graphExplain(key, query)
.map(Response::toString); // TODO Check result format
}
@Override
public Uni> graphList() {
return super._graphList()
.map(r -> marshaller.decodeAsList(r, typeOfKey));
}
@Override
public Uni>> graphQuery(K key, String query) {
return super._graphQuery(key, query)
.map(ReactiveGraphCommandsImpl::decodeQueryResponse);
}
@Override
public Uni>> graphQuery(K key, String query, Duration timeout) {
return super._graphQuery(key, query, timeout)
.map(ReactiveGraphCommandsImpl::decodeQueryResponse);
}
static List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy