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

io.quarkus.redis.runtime.datasource.BlockingAutoSuggestCommandsImpl 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.autosuggest.AutoSuggestCommands;
import io.quarkus.redis.datasource.autosuggest.GetArgs;
import io.quarkus.redis.datasource.autosuggest.ReactiveAutoSuggestCommands;
import io.quarkus.redis.datasource.autosuggest.Suggestion;

public class BlockingAutoSuggestCommandsImpl extends AbstractRedisCommandGroup implements AutoSuggestCommands {

    private final ReactiveAutoSuggestCommands reactive;

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

    @Override
    public long ftSugAdd(K key, String string, double score, boolean increment) {
        return reactive.ftSugAdd(key, string, score, increment).await().atMost(timeout);
    }

    @Override
    public boolean ftSugDel(K key, String string) {
        return reactive.ftSugDel(key, string).await().atMost(timeout);
    }

    @Override
    public List ftSugGet(K key, String prefix) {
        return reactive.ftSugGet(key, prefix).await().atMost(timeout);
    }

    @Override
    public List ftSugGet(K key, String prefix, GetArgs args) {
        return reactive.ftSugGet(key, prefix, args).await().atMost(timeout);
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy