Interface StateIterator<T>
-
- Type Parameters:
T- The element type of this iterator.
@Experimental public interface StateIterator<T>Asynchronous iterators allow to iterate over data that comes asynchronously, on-demand.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisEmpty()Return if this iterator is empty synchronously.StateFuture<Void>onNext(java.util.function.Consumer<T> iterating)Async iterate the data and call the callback when data is ready.<U> StateFuture<Collection<U>>onNext(java.util.function.Function<T,StateFuture<? extends U>> iterating)Async iterate the data and call the callback when data is ready.
-
-
-
Method Detail
-
onNext
<U> StateFuture<Collection<U>> onNext(java.util.function.Function<T,StateFuture<? extends U>> iterating)
Async iterate the data and call the callback when data is ready.- Type Parameters:
U- the type of the inner returned StateFuture's result.- Parameters:
iterating- the data action when it is ready. The return is the state future for chaining.- Returns:
- the Future that will trigger when this iterator and all returned state future get its results.
-
onNext
StateFuture<Void> onNext(java.util.function.Consumer<T> iterating)
Async iterate the data and call the callback when data is ready.- Parameters:
iterating- the data action when it is ready.- Returns:
- the Future that will trigger when this iterator ends.
-
isEmpty
boolean isEmpty()
Return if this iterator is empty synchronously.
-
-