Package io.servicetalk.concurrent.api
Interface AsyncCloseable
-
- All Known Subinterfaces:
AutoRetryStrategyProvider.AutoRetryStrategy,BasicAuthHttpServiceFilter.CredentialsVerifier<UserInfo>,ClientGroup<Key,Client>,CompositeCloseable,ConnectionAcceptor,ConnectionContext,ConnectionFactory<ResolvedAddress,C>,EventLoopAwareNettyIoExecutor,Executor,FilterableGrpcClient,FilterableReservedStreamingHttpConnection,FilterableStreamingHttpClient,FilterableStreamingHttpConnection,FilterableStreamingHttpLoadBalancedConnection,GrpcClient<BlockingClient>,GrpcClientCallFactory,GrpcRoutes.AllGrpcRoutes,GrpcRoutes.RequestStreamingRoute<Req,Resp>,GrpcRoutes.ResponseStreamingRoute<Req,Resp>,GrpcRoutes.Route<Req,Resp>,GrpcRoutes.StreamingRoute<Req,Resp>,GrpcService,GrpcServiceContext,HttpClient,HttpConnection,HttpConnectionContext,HttpRequester,HttpService,IoExecutor,ListenableAsyncCloseable,LoadBalancedAddress<C>,LoadBalancedConnection,LoadBalancer<C>,NettyConnection<Read,Write>,NettyConnectionContext,NettyIoExecutor,PartitionMap<T>,ReservedHttpConnection,ReservedStreamingHttpConnection,ServerContext,ServiceDiscoverer<UnresolvedAddress,ResolvedAddress,E>,StreamingHttpClient,StreamingHttpConnection,StreamingHttpRequester,StreamingHttpService
- All Known Implementing Classes:
ChannelSet,DefaultNettyConnection,DefaultPartitionedClientGroup,DelegatingConnectionAcceptor,DelegatingConnectionContext,DelegatingConnectionFactory,DelegatingExecutor,DelegatingHttpConnectionContext,DelegatingHttpServiceContext,HttpReporter,HttpServiceContext,NettyChannelListenableAsyncCloseable,NettyServerContext,OffloaderAwareExecutor,PowerSetPartitionMap,ReservedStreamingHttpConnectionFilter,RoundRobinLoadBalancer,StreamingHttpClientFilter,StreamingHttpConnectionFilter,StreamingHttpServiceFilter,TestExecutor,TestHttpServiceContext,UdpReporter,ZipkinPublisher
- 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 AsyncCloseableUsed to close/shutdown a resource.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CompletablecloseAsync()Used to close/shutdown a resource.default CompletablecloseAsyncGracefully()Used to close/shutdown a resource, similar tocloseAsync(), but attempts to cleanup state before abruptly closing.
-
-
-
Method Detail
-
closeAsync
Completable closeAsync()
Used to close/shutdown a resource.- Returns:
- A
Completablethat is notified once the close is complete.
-
closeAsyncGracefully
default Completable closeAsyncGracefully()
Used to close/shutdown a resource, similar tocloseAsync(), but attempts to cleanup state before abruptly closing. This provides a hint that implementations can use to stop accepting new work and finish in flight work. This method is implemented on a "best effort" basis and may be equivalent tocloseAsync().Note: Implementations may or may not apply a timeout for this operation to complete, if a caller does not want to wait indefinitely, and are unsure if the implementation applies a timeout, it is advisable to apply a timeout and force a call to
closeAsync().- Returns:
- A
Completablethat is notified once the close is complete.
-
-