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

io.quarkus.redis.runtime.datasource.ReactiveTransactionalCuckooCommandsImpl 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.cuckoo.CfInsertArgs;
import io.quarkus.redis.datasource.cuckoo.CfReserveArgs;
import io.quarkus.redis.datasource.cuckoo.ReactiveTransactionalCuckooCommands;
import io.quarkus.redis.datasource.transactions.ReactiveTransactionalRedisDataSource;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Response;

public class ReactiveTransactionalCuckooCommandsImpl extends AbstractTransactionalCommands
        implements ReactiveTransactionalCuckooCommands {

    private final ReactiveCuckooCommandsImpl reactive;

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

    @Override
    public Uni cfadd(K key, V value) {
        this.tx.enqueue(r -> null); // Uni
        return this.reactive._cfadd(key, value).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni cfaddnx(K key, V value) {
        this.tx.enqueue(Response::toBoolean); // Uni
        return this.reactive._cfaddnx(key, value).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni cfcount(K key, V value) {
        this.tx.enqueue(Response::toLong); // Uni
        return this.reactive._cfcount(key, value).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni cfdel(K key, V value) {
        this.tx.enqueue(Response::toBoolean); // Uni
        return this.reactive._cfdel(key, value).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni cfexists(K key, V value) {
        this.tx.enqueue(Response::toBoolean); // Uni
        return this.reactive._cfexists(key, value).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni cfinsert(K key, V... values) {
        this.tx.enqueue(r -> null);
        return this.reactive._cfinsert(key, values).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni cfinsert(K key, CfInsertArgs args, V... values) {
        this.tx.enqueue(r -> null);
        return this.reactive._cfinsert(key, args, values).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni cfinsertnx(K key, V... values) {
        this.tx.enqueue(ReactiveBloomCommandsImpl::decodeAsListOfBooleans); // Uni>
        return this.reactive._cfinsertnx(key, values).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni cfinsertnx(K key, CfInsertArgs args, V... values) {
        this.tx.enqueue(ReactiveBloomCommandsImpl::decodeAsListOfBooleans); // Uni>
        return this.reactive._cfinsertnx(key, args, values).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni cfmexists(K key, V... values) {
        this.tx.enqueue(ReactiveBloomCommandsImpl::decodeAsListOfBooleans); // Uni>
        return this.reactive._cfmexists(key, values).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni cfreserve(K key, long capacity) {
        this.tx.enqueue(r -> null); // Uni
        return this.reactive._cfreserve(key, capacity).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni cfreserve(K key, long capacity, CfReserveArgs args) {
        this.tx.enqueue(r -> null); // Uni
        return this.reactive._cfreserve(key, capacity, args).invoke(this::queuedOrDiscard).replaceWithVoid();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy