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

io.quarkus.redis.runtime.datasource.BlockingSetCommandsImpl 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 java.util.Set;

import io.quarkus.redis.datasource.RedisDataSource;
import io.quarkus.redis.datasource.ScanArgs;
import io.quarkus.redis.datasource.SortArgs;
import io.quarkus.redis.datasource.set.ReactiveSetCommands;
import io.quarkus.redis.datasource.set.SScanCursor;
import io.quarkus.redis.datasource.set.SetCommands;

public class BlockingSetCommandsImpl extends AbstractRedisCommandGroup implements SetCommands {

    private final ReactiveSetCommands reactive;

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

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

    @Override
    public long scard(K key) {
        return reactive.scard(key).await().atMost(timeout);
    }

    @Override
    public Set sdiff(K... keys) {
        return reactive.sdiff(keys)
                .await().atMost(timeout);
    }

    @Override
    public long sdiffstore(K destination, K... keys) {
        return reactive.sdiffstore(destination, keys)
                .await().atMost(timeout);
    }

    @Override
    public Set sinter(K... keys) {
        return reactive.sinter(keys)
                .await().atMost(timeout);
    }

    @Override
    public long sintercard(K... keys) {
        return reactive.sintercard(keys)
                .await().atMost(timeout);
    }

    @Override
    public long sintercard(int limit, K... keys) {
        return reactive.sintercard(limit, keys)
                .await().atMost(timeout);
    }

    @Override
    public long sinterstore(K destination, K... keys) {
        return reactive.sinterstore(destination, keys)
                .await().atMost(timeout);
    }

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

    @Override
    public Set smembers(K key) {
        return reactive.smembers(key)
                .await().atMost(timeout);
    }

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

    @Override
    public boolean smove(K source, K destination, V member) {
        return reactive.smove(source, destination, member)
                .await().atMost(timeout);
    }

    @Override
    public V spop(K key) {
        return reactive.spop(key)
                .await().atMost(timeout);
    }

    @Override
    public Set spop(K key, int count) {
        return reactive.spop(key, count)
                .await().atMost(timeout);
    }

    @Override
    public V srandmember(K key) {
        return reactive.srandmember(key)
                .await().atMost(timeout);
    }

    @Override
    public List srandmember(K key, int count) {
        return reactive.srandmember(key, count)
                .await().atMost(timeout);
    }

    @Override
    public int srem(K key, V... members) {
        return reactive.srem(key, members)
                .await().atMost(timeout);
    }

    @Override
    public Set sunion(K... keys) {
        return reactive.sunion(keys)
                .await().atMost(timeout);
    }

    @Override
    public long sunionstore(K destination, K... keys) {
        return reactive.sunionstore(destination, keys)
                .await().atMost(timeout);
    }

    @Override
    public SScanCursor sscan(K key) {
        return new SScanBlockingCursorImpl<>(reactive.sscan(key), timeout);
    }

    @Override
    public SScanCursor sscan(K key, ScanArgs scanArgs) {
        return new SScanBlockingCursorImpl<>(reactive.sscan(key, scanArgs), timeout);
    }

    @Override
    public List sort(K key) {
        return reactive.sort(key)
                .await().atMost(timeout);
    }

    @Override
    public List sort(K key, SortArgs sortArguments) {
        return reactive.sort(key, sortArguments)
                .await().atMost(timeout);
    }

    @Override
    public long sortAndStore(K key, K destination, SortArgs sortArguments) {
        return reactive.sortAndStore(key, destination, sortArguments)
                .await().atMost(timeout);
    }

    @Override
    public long sortAndStore(K key, K destination) {
        return reactive.sortAndStore(key, destination)
                .await().atMost(timeout);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy