public interface AsyncEnumerator<T>
| Modifier and Type | Method | Description |
|---|---|---|
void |
cancel() |
Instructs the AsyncEnumerator to cancel any outstanding async activity and
release resources associated with it.
|
T |
current() |
Returns the current item when the CompletionStage returned by
moveNext()
completes with true. |
CompletionStage<Boolean> |
moveNext() |
Asks the AsyncEnumerator to fetch the next item and notify its availability
by completing the returned CompletionStage with:
true if there is
an item is ready to be read via current(); false if
there won't be any more items; or containing the Throwable indicating
an error. |
CompletionStage<Boolean> moveNext()
true if there is
an item is ready to be read via current(); false if
there won't be any more items; or containing the Throwable indicating
an error.
The method should not be called if it was called recently and the CompletionStage hasn't terminated yet.
T current()
moveNext()
completes with true.
This method should not be called without calling
moveNext() first and while the CompletionStage of moveNext() hasn't
completed yet or has been completed with false or with a Throwable.
void cancel()