io.quarkus.redis.runtime.datasource.ReactiveTransactionalGraphCommandsImpl 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 io.quarkus.redis.datasource.graph.ReactiveTransactionalGraphCommands;
import io.quarkus.redis.datasource.transactions.ReactiveTransactionalRedisDataSource;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Response;
public class ReactiveTransactionalGraphCommandsImpl extends AbstractTransactionalCommands
implements ReactiveTransactionalGraphCommands {
private final ReactiveGraphCommandsImpl reactive;
public ReactiveTransactionalGraphCommandsImpl(ReactiveTransactionalRedisDataSource ds,
ReactiveGraphCommandsImpl reactive, TransactionHolder tx) {
super(ds, tx);
this.reactive = reactive;
}
@Override
public Uni graphDelete(K key) {
this.tx.enqueue(x -> null);
return this.reactive._graphDelete(key).invoke(this::queuedOrDiscard).replaceWithVoid();
}
@Override
public Uni graphExplain(K key, String query) {
this.tx.enqueue(Response::toString);
return this.reactive._graphExplain(key, query).invoke(this::queuedOrDiscard).replaceWithVoid();
}
@Override
public Uni graphList() {
this.tx.enqueue(r -> reactive.marshaller.decodeAsList(r, reactive.typeOfKey));
return this.reactive._graphList().invoke(this::queuedOrDiscard).replaceWithVoid();
}
@Override
public Uni graphQuery(K key, String query) {
this.tx.enqueue(ReactiveGraphCommandsImpl::decodeQueryResponse); // Uni>>
return this.reactive._graphQuery(key, query).invoke(this::queuedOrDiscard).replaceWithVoid();
}
@Override
public Uni graphQuery(K key, String query, Duration timeout) {
this.tx.enqueue(ReactiveGraphCommandsImpl::decodeQueryResponse); // Uni>>
return this.reactive._graphQuery(key, query, timeout).invoke(this::queuedOrDiscard).replaceWithVoid();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy