io.quarkus.redis.runtime.datasource.SScanBlockingCursorImpl 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 java.time.Duration;
import java.util.List;
import io.quarkus.redis.datasource.set.ReactiveSScanCursor;
import io.quarkus.redis.datasource.set.SScanCursor;
public class SScanBlockingCursorImpl implements SScanCursor {
private final ReactiveSScanCursor reactive;
private final Duration timeout;
public SScanBlockingCursorImpl(ReactiveSScanCursor reactive, Duration timeout) {
this.timeout = timeout;
this.reactive = reactive;
}
@Override
public boolean hasNext() {
return reactive.hasNext();
}
@Override
public List next() {
return reactive.next().await().atMost(timeout);
}
@Override
public long cursorId() {
return reactive.cursorId();
}
@Override
public Iterable toIterable() {
return reactive.toMulti().subscribe().asIterable();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy