All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.redis.runtime.datasource.ReactiveTransactionalHyperLogLogCommandsImpl Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package io.quarkus.redis.runtime.datasource;

import io.quarkus.redis.datasource.hyperloglog.ReactiveTransactionalHyperLogLogCommands;
import io.quarkus.redis.datasource.transactions.ReactiveTransactionalRedisDataSource;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Response;

public class ReactiveTransactionalHyperLogLogCommandsImpl extends AbstractTransactionalCommands
        implements ReactiveTransactionalHyperLogLogCommands {

    private final ReactiveHyperLogLogCommandsImpl reactive;

    public ReactiveTransactionalHyperLogLogCommandsImpl(ReactiveTransactionalRedisDataSource ds,
            ReactiveHyperLogLogCommandsImpl reactive, TransactionHolder tx) {
        super(ds, tx);
        this.reactive = reactive;
    }

    @Override
    public Uni pfadd(K key, V... values) {
        this.tx.enqueue(Response::toBoolean);
        return this.reactive._pfadd(key, values).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni pfmerge(K destkey, K... sourcekeys) {
        this.tx.enqueue(resp -> null);
        return this.reactive._pfmerge(destkey, sourcekeys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni pfcount(K... keys) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._pfcount(keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy