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.

@FunctionalInterface public static interface AsyncStreamResponse.Handler<T>
Handler interface for processing streaming responses.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called when the stream completes, either successfully or with an error.
    void
    onNext(T item)
    Called for each item in the stream.
  • Method Details

    • onNext

      void onNext(T item)
      Called for each item in the stream.
      Parameters:
      item - The item to process
    • onComplete

      default void onComplete(Optional<Throwable> error)
      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