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

io.quarkus.redis.runtime.datasource.ReactiveTransactionalBitMapCommandsImpl 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.bitmap.BitFieldArgs;
import io.quarkus.redis.datasource.bitmap.ReactiveTransactionalBitMapCommands;
import io.quarkus.redis.datasource.transactions.ReactiveTransactionalRedisDataSource;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Response;

public class ReactiveTransactionalBitMapCommandsImpl extends AbstractTransactionalCommands
        implements ReactiveTransactionalBitMapCommands {

    private final ReactiveBitMapCommandsImpl reactive;

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

    @Override
    public Uni bitcount(K key) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._bitcount(key).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bitcount(K key, long start, long end) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._bitcount(key, start, end).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni getbit(K key, long offset) {
        this.tx.enqueue(Response::toInteger);
        return this.reactive._getbit(key, offset).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bitfield(K key, BitFieldArgs bitFieldArgs) {
        this.tx.enqueue(this.reactive::decodeListOfLongs);
        return this.reactive._bitfield(key, bitFieldArgs).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bitpos(K key, int valueToLookFor) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._bitpos(key, valueToLookFor).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bitpos(K key, int bit, long start) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._bitpos(key, bit, start).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bitpos(K key, int bit, long start, long end) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._bitpos(key, bit, start, end).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bitopAnd(K destination, K... keys) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._bitopAnd(destination, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bitopNot(K destination, K source) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._bitopNot(destination, source).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bitopOr(K destination, K... keys) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._bitopOr(destination, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni bitopXor(K destination, K... keys) {
        this.tx.enqueue(Response::toLong);
        return this.reactive._bitopXor(destination, keys).invoke(this::queuedOrDiscard).replaceWithVoid();
    }

    @Override
    public Uni setbit(K key, long offset, int value) {
        this.tx.enqueue(Response::toInteger);
        return this.reactive._setbit(key, offset, value).invoke(this::queuedOrDiscard).replaceWithVoid();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy