CavalliumDBEngine/src/main/java/it/cavallium/dbengine/lucene/ResourceIterable.java

28 lines
587 B
Java
Raw Normal View History

package it.cavallium.dbengine.lucene;
2022-06-30 15:06:10 +02:00
import it.cavallium.dbengine.database.DiscardingCloseable;
import it.cavallium.dbengine.database.SafeCloseable;
import java.io.Closeable;
import java.util.Iterator;
import org.jetbrains.annotations.NotNull;
import reactor.core.publisher.Flux;
2022-06-30 15:06:10 +02:00
public interface ResourceIterable<T> extends DiscardingCloseable {
/**
* Iterate this PriorityQueue
*/
Flux<T> iterate();
/**
* Iterate this PriorityQueue
*/
default Flux<T> iterate(long skips) {
if (skips == 0) {
return iterate();
} else {
return iterate().skip(skips);
}
}
}