Package vn.payos.core
Interface AsyncStreamResponse.Handler<T>
- Type Parameters:
T- The type of items being processed
- Enclosing interface:
- AsyncStreamResponse<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Handler interface for processing streaming responses.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonComplete(Optional<Throwable> error) Called when the stream completes, either successfully or with an error.voidCalled for each item in the stream.
-
Method Details
-
onNext
Called for each item in the stream.- Parameters:
item- The item to process
-
onComplete
Called when the stream completes, either successfully or with an error.onNext will not be called once this method is called.
- Parameters:
error- Non-empty if the stream completed due to an error
-