Interface TransportObserver

All Known Implementing Classes:
NoopTransportObserver

public interface TransportObserver
An observer interface that provides visibility into transport events.

In order to deliver events at accurate time, callbacks on this interface can be invoked from the IoExecutor. Implementation of this observer must be non-blocking. If the consumer of events may block (uses a blocking library or logger configuration is not async), it has to offload publications to another Executor after capturing timing of events. If blocking code is executed inside callbacks without offloading, it will negatively impact IoExecutor and overall performance of the application.

  • Method Details

    • onNewConnection

      @Deprecated default ConnectionObserver onNewConnection()
      Callback when transport starts initializing a new network connection.
      Returns:
      a new ConnectionObserver that provides visibility into events associated with a new connection
    • onNewConnection

      ConnectionObserver onNewConnection(@Nullable Object localAddress, Object remoteAddress)
      Callback when transport starts initializing a new network connection.
      Parameters:
      localAddress - a local address of a new connection, if known
      remoteAddress - a remote address of a new connection
      Returns:
      a new ConnectionObserver that provides visibility into events associated with a new connection