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.
Holds contextual information for the underlying channel and provides
non-blocking resource disposing API.
- Since:
- 0.7
- Author:
- Stephane Maldini
-
Nested Class Summary
Nested classes/interfaces inherited from interface reactor.core.Disposable
Disposable.Composite, Disposable.Swap
-
Method Summary
Modifier and TypeMethodDescriptiondefault SocketAddress
address()
When on the server, returns the bind address, when on the client, returns the remote address.channel()
Returns the underlyingChannel
.default void
dispose()
Releases or closes the underlyingChannel
.default void
Releases or closes the underlyingChannel
in a blocking fashion with3
seconds default timeout.default void
disposeNow
(Duration timeout) Releases or closes the underlyingChannel
in a blocking fashion with the provided timeout.default CoreSubscriber<Void>
Returns aCoreSubscriber
that will dispose on complete or error.default boolean
Returns an observingMono
terminating with success when shutdown successfully or error.default DisposableChannel
onDispose
(Disposable onDispose) Assigns aDisposable
to be invoked when the channel is closed.
-
Method Details
-
address
When on the server, returns the bind address, when on the client, returns the remote address.- Returns:
SocketAddress
-
channel
Channel channel()Returns the underlyingChannel
. 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 underlyingChannel
.- Specified by:
dispose
in interfaceDisposable
-
disposeNow
default void disposeNow()Releases or closes the underlyingChannel
in a blocking fashion with3
seconds default timeout. -
disposeNow
Releases or closes the underlyingChannel
in a blocking fashion with the provided timeout.- Parameters:
timeout
- max dispose timeout (resolution: ns)
-
disposeSubscriber
Returns aCoreSubscriber
that will dispose on complete or error. -
isDisposed
default boolean isDisposed()- Specified by:
isDisposed
in interfaceDisposable
-
onDispose
Returns an observingMono
terminating with success when shutdown successfully or error.- Returns:
- a
Mono
terminating with success if shutdown successfully or error
-
onDispose
Assigns aDisposable
to be invoked when the channel is closed.- Parameters:
onDispose
- the close event handler- Returns:
- this
-