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

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

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

import java.time.Duration;
import java.util.List;

import io.quarkus.redis.datasource.RedisDataSource;
import io.quarkus.redis.datasource.bloom.BfInsertArgs;
import io.quarkus.redis.datasource.bloom.BfReserveArgs;
import io.quarkus.redis.datasource.bloom.BloomCommands;
import io.quarkus.redis.datasource.bloom.ReactiveBloomCommands;

public class BlockingBloomCommandsImpl extends AbstractRedisCommandGroup implements BloomCommands {

    private final ReactiveBloomCommands reactive;

    public BlockingBloomCommandsImpl(RedisDataSource ds, ReactiveBloomCommands reactive, Duration timeout) {
        super(ds, timeout);
        this.reactive = reactive;
    }

    @Override
    public boolean bfadd(K key, V value) {
        return reactive.bfadd(key, value)
                .await().atMost(timeout);
    }

    @Override
    public boolean bfexists(K key, V value) {
        return reactive.bfexists(key, value)
                .await().atMost(timeout);
    }

    @Override
    public List bfmadd(K key, V... values) {
        return reactive.bfmadd(key, values)
                .await().atMost(timeout);
    }

    @Override
    public List bfmexists(K key, V... values) {
        return reactive.bfmexists(key, values)
                .await().atMost(timeout);
    }

    @Override
    public void bfreserve(K key, double errorRate, long capacity) {
        reactive.bfreserve(key, errorRate, capacity)
                .await().atMost(timeout);
    }

    @Override
    public void bfreserve(K key, double errorRate, long capacity, BfReserveArgs args) {
        reactive.bfreserve(key, errorRate, capacity, args)
                .await().atMost(timeout);
    }

    @Override
    public List bfinsert(K key, BfInsertArgs args, V... values) {
        return reactive.bfinsert(key, args, values)
                .await().atMost(timeout);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy