Interface ConnectionObserver.ReadObserver

All Known Implementing Classes:
NoopTransportObserver.NoopReadObserver
Enclosing interface:
ConnectionObserver

public static interface ConnectionObserver.ReadObserver
An observer interface that provides visibility into read events.

Either readComplete() or readFailed(Throwable) will be invoked to signal when a read operation terminates. readCancelled() is also a terminal signal for the read operation, however it may be invoked concurrently with readComplete() or readFailed(Throwable).

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Deprecated.
    default void
    Callback when a new item is read.
    default void
    Callback when the read operation is cancelled.
    default void
    Callback when the entire read operation completes successfully.
    default void
    Callback when the read operation fails with an error.
    default void
    Callback when new items are requested to be read.
  • Method Details

    • requestedToRead

      default void requestedToRead(long n)
      Callback when new items are requested to be read.
      Parameters:
      n - number of requested items to read
    • itemRead

      @Deprecated default void itemRead()
      Deprecated.
      Callback when a new item is read.

      Content of the read items should be inspected at the higher level API when these items are consumed.

    • itemRead

      default void itemRead(@Nullable Object item)
      Callback when a new item is read.
      Parameters:
      item - the item that was read
    • readFailed

      default void readFailed(Throwable cause)
      Callback when the read operation fails with an error.
      Parameters:
      cause - Throwable that terminated the read
    • readComplete

      default void readComplete()
      Callback when the entire read operation completes successfully.
    • readCancelled

      default void readCancelled()
      Callback when the read operation is cancelled.