Interface WriteStreamSubscriber<T>

Type Parameters:
T - the type of item.
All Superinterfaces:
Flow.Subscriber<T>

public interface WriteStreamSubscriber<T> extends Flow.Subscriber<T>
A WriteStream to Flow.Subscriber adapter.
  • Method Details

    • onFailure

      WriteStreamSubscriber<T> onFailure(Consumer<? super Throwable> callback)
      Sets the handler to invoke on failure events.

      The underlying WriteStream.end() method is not invoked in this case.

      Parameters:
      callback - the callback invoked with the failure
      Returns:
      a reference to this, so the API can be used fluently
    • onComplete

      WriteStreamSubscriber<T> onComplete(Runnable callback)
      Sets the handler to invoke on completion events.

      The underlying WriteStream.end() method is invoked before the given callback.

      Parameters:
      callback - the callback invoked when the completion event is received
      Returns:
      a reference to this, so the API can be used fluently
    • onWriteStreamError

      WriteStreamSubscriber<T> onWriteStreamError(Consumer<? super Throwable> callback)
      Sets the handler to invoke if the adapted WriteStream fails.

      The underlying WriteStream.end() method is not invoked in this case.

      Parameters:
      callback - the callback invoked with the failure
      Returns:
      a reference to this, so the API can be used fluently