io.quarkus.redis.runtime.datasource.ReactiveTransactionalAutoSuggestCommandsImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-redis-client Show documentation
Show all versions of quarkus-redis-client Show documentation
Connect to Redis in either imperative or reactive style
package io.quarkus.redis.runtime.datasource;
import io.quarkus.redis.datasource.autosuggest.GetArgs;
import io.quarkus.redis.datasource.autosuggest.ReactiveTransactionalAutoSuggestCommands;
import io.quarkus.redis.datasource.transactions.ReactiveTransactionalRedisDataSource;
import io.smallrye.mutiny.Uni;
import io.vertx.mutiny.redis.client.Response;
public class ReactiveTransactionalAutoSuggestCommandsImpl extends AbstractTransactionalCommands
implements ReactiveTransactionalAutoSuggestCommands {
private final ReactiveAutoSuggestCommandsImpl reactive;
public ReactiveTransactionalAutoSuggestCommandsImpl(ReactiveTransactionalRedisDataSource ds,
ReactiveAutoSuggestCommandsImpl reactive, TransactionHolder tx) {
super(ds, tx);
this.reactive = reactive;
}
@Override
public Uni ftSugAdd(K key, String string, double score, boolean increment) {
this.tx.enqueue(Response::toLong); // Uni
return this.reactive._ftSugAdd(key, string, score, increment).invoke(this::queuedOrDiscard).replaceWithVoid();
}
@Override
public Uni ftSugDel(K key, String string) {
this.tx.enqueue(Response::toBoolean); // Uni
return this.reactive._ftSugDel(key, string).invoke(this::queuedOrDiscard).replaceWithVoid();
}
@Override
public Uni ftSugget(K key, String prefix) {
this.tx.enqueue(r -> reactive.decodeAsListOfSuggestion(r, false));
return this.reactive._ftSugget(key, prefix).invoke(this::queuedOrDiscard).replaceWithVoid();
}
@Override
public Uni ftSugget(K key, String prefix, GetArgs args) {
this.tx.enqueue(r -> reactive.decodeAsListOfSuggestion(r, args.hasScores()));
return this.reactive._ftSugget(key, prefix, args).invoke(this::queuedOrDiscard).replaceWithVoid();
}
@Override
public Uni ftSugLen(K key) {
this.tx.enqueue(Response::toLong);
return this.reactive._ftSugLen(key).invoke(this::queuedOrDiscard).replaceWithVoid();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy