Package io.servicetalk.concurrent.api
Interface ListenableAsyncCloseable
- All Superinterfaces:
AsyncCloseable
- All Known Subinterfaces:
ClientGroup<Key,,Client> ConnectionContext,ConnectionFactory<ResolvedAddress,,C> EventLoopAwareNettyIoExecutor,Executor,FilterableReservedStreamingHttpConnection,FilterableStreamingHttpClient,FilterableStreamingHttpConnection,FilterableStreamingHttpLoadBalancedConnection,GrpcClient<BlockingClient>,GrpcClientCallFactory,GrpcServerContext,GrpcServiceContext,Health.HealthClient,HttpClient,HttpConnection,HttpConnectionContext,HttpRequester,HttpServerContext,IoExecutor,LoadBalancedAddress<C>,LoadBalancedConnection,LoadBalancer<C>,NettyConnection<Read,,Write> NettyConnectionContext,NettyIoExecutor,PartitionMap<T>,ReservedHttpConnection,ReservedStreamingHttpConnection,ServerContext,ServiceDiscoverer<UnresolvedAddress,,ResolvedAddress, E> StreamingHttpClient,StreamingHttpConnection,StreamingHttpRequester
- All Known Implementing Classes:
ChannelSet,DefaultNettyConnection,DefaultPartitionedClientGroup,DelegatingConnectionContext,DelegatingConnectionFactory,DelegatingExecutor,DelegatingFilterableStreamingHttpLoadBalancedConnection,DelegatingHttpConnectionContext,DelegatingHttpServiceContext,DelegatingListenableAsyncCloseable,DelegatingServiceDiscoverer,HttpLoadBalancerFactory.DefaultFilterableStreamingHttpLoadBalancedConnection,HttpServiceContext,NettyChannelListenableAsyncCloseable,NettyPipelinedConnection,NettyServerContext,PowerSetPartitionMap,ReservedStreamingHttpConnectionFilter,StreamingHttpClientFilter,StreamingHttpConnectionFilter
Provides a way to subscribe when
AsyncCloseable.closeAsync() is completed.-
Method Summary
Modifier and TypeMethodDescriptiononClose()Returns aCompletablethat is notified once theListenableAsyncCloseablewas closed.default CompletableReturns aCompletablethat is notified when closing begins.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefully
-
Method Details
-
onClose
Completable onClose()Returns aCompletablethat is notified once theListenableAsyncCloseablewas closed.- Returns:
- the
Completablethat is notified on close.
-
onClosing
Returns aCompletablethat is notified when closing begins.Closing begin might be when a close operation is initiated locally (e.g. subscribing to
AsyncCloseable.closeAsync()) or it could also be a transport event received from a remote peer (e.g. read aconnection: closeheader).For backwards compatibility this method maybe functionally equivalent to
onClose(). Therefore, provides a best-effort leading edge notification of closing, but may fall back to notification on trailing edge.The goal of this method is often to notify asap when closing so this method may not be offloaded and care must be taken to avoid blocking if subscribing to the return
Completable.- Returns:
- a
Completablethat is notified when closing begins.
-