Interface ConnectionObserver.WriteObserver

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

public static interface ConnectionObserver.WriteObserver
An observer interface that provides visibility into write events.

Either writeComplete() or writeFailed(Throwable) will be invoked to signal when a write operation terminates. writeCancelled() is also a terminal signal for the write operation, however it may be invoked concurrently with writeComplete() or writeFailed(Throwable).

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Callback when an item is flushed to the network.
    default void
    Deprecated.
    default void
    Callback when an item is received and ready to be written.
    default void
    Deprecated.
    default void
    Callback when an item is serialized and written to the socket.
    default void
    Callback when a flush operation is requested.
    default void
    Callback when new items are requested to be written.
    default void
    Callback when the write operation is cancelled.
    default void
    Callback when the entire write operation completes successfully.
    default void
    Callback when the write operation fails with an error.
  • Method Details

    • requestedToWrite

      default void requestedToWrite(long n)
      Callback when new items are requested to be written.
      Parameters:
      n - number of requested items to write
    • itemReceived

      @Deprecated default void itemReceived()
      Deprecated.
      Callback when an item is received and ready to be written.

      Content of the received items should be inspected at the higher level API when these items are produced.

    • itemReceived

      default void itemReceived(@Nullable Object item)
      Callback when an item is received and ready to be written.
      Parameters:
      item - the received item
    • onFlushRequest

      default void onFlushRequest()
      Callback when a flush operation is requested.
    • itemWritten

      @Deprecated default void itemWritten()
      Deprecated.
      Callback when an item is written to the transport.

      Content of the written items should be inspected at the higher level API when these items are produced.

    • itemWritten

      default void itemWritten(@Nullable Object item)
      Callback when an item is serialized and written to the socket.
      Parameters:
      item - the written item
    • itemFlushed

      default void itemFlushed()
      Callback when an item is flushed to the network. Items are flushed in the order they have been written.
    • writeFailed

      default void writeFailed(Throwable cause)
      Callback when the write operation fails with an error.
      Parameters:
      cause - Throwable that terminated the write
    • writeComplete

      default void writeComplete()
      Callback when the entire write operation completes successfully.
    • writeCancelled

      default void writeCancelled()
      Callback when the write operation is cancelled.