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 SocketAddressaddress()When on the server, returns the bind address, when on the client, returns the remote address.channel()Returns the underlyingChannel.default voiddispose()Releases or closes the underlyingChannel.default voidReleases or closes the underlyingChannelin a blocking fashion with3seconds default timeout.default voiddisposeNow(Duration timeout) Releases or closes the underlyingChannelin a blocking fashion with the provided timeout.default CoreSubscriber<Void>Returns aCoreSubscriberthat will dispose on complete or error.default booleanReturns an observingMonoterminating with success when shutdown successfully or error.default DisposableChannelonDispose(Disposable onDispose) Assigns aDisposableto 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:
disposein interfaceDisposable
-
disposeNow
default void disposeNow()Releases or closes the underlyingChannelin a blocking fashion with3seconds default timeout. -
disposeNow
Releases or closes the underlyingChannelin a blocking fashion with the provided timeout.- Parameters:
timeout- max dispose timeout (resolution: ns)
-
disposeSubscriber
Returns aCoreSubscriberthat will dispose on complete or error. -
isDisposed
default boolean isDisposed()- Specified by:
isDisposedin interfaceDisposable
-
onDispose
Returns an observingMonoterminating with success when shutdown successfully or error.- Returns:
- a
Monoterminating with success if shutdown successfully or error
-
onDispose
Assigns aDisposableto be invoked when the channel is closed.- Parameters:
onDispose- the close event handler- Returns:
- this
-