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

io.quarkus.redis.runtime.datasource.ZScanBlockingCursorImpl 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.sortedset.ReactiveZScanCursor;
import io.quarkus.redis.datasource.sortedset.ScoredValue;
import io.quarkus.redis.datasource.sortedset.ZScanCursor;

public class ZScanBlockingCursorImpl implements ZScanCursor {

    private final ReactiveZScanCursor reactive;
    private final Duration timeout;

    public ZScanBlockingCursorImpl(ReactiveZScanCursor 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