T
- The type of the stream element.@FunctionalInterface
public interface AsyncStreamHandler<T>
AsyncStream
.Modifier and Type | Method and Description |
---|---|
default void |
onComplete()
A terminal signal indicating that the stream terminated successfully.
|
default void |
onError(java.lang.Throwable throwable)
A terminal signal indicating that the stream terminated due to an error.
|
default void |
onInit(CancellationToken cancellationToken)
Invoked before initiating element retrieval from the stream.
|
void |
onNext(T e)
The next element produced by the stream.
|
default void onInit(CancellationToken cancellationToken)
cancellationToken
- The token to cancel the steam from producing
and delivering elements to onNext(e)
.void onNext(T e)
e
- the element signaled.default void onError(java.lang.Throwable throwable)
throwable
- the error signaled.default void onComplete()