Package reactor.netty

Interface DisposableChannel

All Superinterfaces:
Disposable
All Known Subinterfaces:
Connection, DisposableServer, QuicConnection
All Known Implementing Classes:
ChannelOperations, HttpOperations
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 interface DisposableChannel extends Disposable
Holds contextual information for the underlying channel and provides non-blocking resource disposing API.
Since:
0.7
Author:
Stephane Maldini
  • Method Details

    • address

      default SocketAddress address()
      When on the server, returns the bind address, when on the client, returns the remote address.
      Returns:
      SocketAddress
    • channel

      Channel channel()
      Returns the underlying Channel. Direct interaction might be considered insecure if that affects the underlying I/O processing such as read, write or close or state such as pipeline handler addition/removal.
      Returns:
      the underlying Channel
    • dispose

      default void dispose()
      Releases or closes the underlying Channel.
      Specified by:
      dispose in interface Disposable
    • disposeNow

      default void disposeNow()
      Releases or closes the underlying Channel in a blocking fashion with 3 seconds default timeout.
    • disposeNow

      default void disposeNow(Duration timeout)
      Releases or closes the underlying Channel in a blocking fashion with the provided timeout.
      Parameters:
      timeout - max dispose timeout (resolution: ns)
    • disposeSubscriber

      default CoreSubscriber<Void> disposeSubscriber()
      Returns a CoreSubscriber that will dispose on complete or error.
    • isDisposed

      default boolean isDisposed()
      Specified by:
      isDisposed in interface Disposable
    • onDispose

      default Mono<Void> onDispose()
      Returns an observing Mono terminating with success when shutdown successfully or error.
      Returns:
      a Mono terminating with success if shutdown successfully or error
    • onDispose

      default DisposableChannel onDispose(Disposable onDispose)
      Assigns a Disposable to be invoked when the channel is closed.
      Parameters:
      onDispose - the close event handler
      Returns:
      this