io.quarkus.redis.runtime.datasource.ReactiveTransactionalTopKCommandsImpl 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.util.Map;
import io.quarkus.redis.datasource.topk.ReactiveTransactionalTopKCommands;
import io.quarkus.redis.datasource.transactions.ReactiveTransactionalRedisDataSource;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Response;
public class ReactiveTransactionalTopKCommandsImpl extends AbstractTransactionalCommands
implements ReactiveTransactionalTopKCommands {
private final ReactiveTopKCommandsImpl reactive;
public ReactiveTransactionalTopKCommandsImpl(ReactiveTransactionalRedisDataSource ds,
ReactiveTopKCommandsImpl reactive, TransactionHolder tx) {
super(ds, tx);
this.reactive = reactive;
}
@Override
public Uni topkAdd(K key, V item) {
this.tx.enqueue(r -> reactive.marshaller.decodeAsList(r, reactive.typeOfValue).get(0)); // Uni
return this.reactive._topkAdd(key, item).invoke(this::queuedOrDiscard).replaceWithVoid();
}
@Override
public Uni topkAdd(K key, V... items) {
this.tx.enqueue(r -> reactive.marshaller.decodeAsList(r, reactive.typeOfValue)); // Uni>
return this.reactive._topkAdd(key, items).invoke(this::queuedOrDiscard).replaceWithVoid();
}
@Override
public Uni topkIncrBy(K key, V item, int increment) {
this.tx.enqueue(r -> reactive.marshaller.decodeAsList(r, reactive.typeOfValue).get(0)); // Uni
return this.reactive._topkIncrBy(key, item, increment).invoke(this::queuedOrDiscard).replaceWithVoid();
}
@Override
public Uni topkIncrBy(K key, Map couples) {
this.tx.enqueue(r -> reactive.decodeAsMapVV(couples, r)); // Uni
© 2015 - 2025 Weber Informatics LLC | Privacy Policy