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 Detail

      • onNext

        <U> StateFuture<Collection<U>> onNext​(FunctionWithException<T,​StateFuture<? extends U>,​Exception> 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​(ThrowingConsumer<T,​Exception> 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.