Package com.linecorp.armeria.common.util
Interface AsyncCloseable
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
ClientFactory,EndpointGroup,ListenableAsyncCloseable
- All Known Implementing Classes:
AsyncCloseableSupport,ConsulEndpointGroup,DecoratingClientFactory,DnsAddressEndpointGroup,DnsServiceEndpointGroup,DnsTextEndpointGroup,DynamicEndpointGroup,Endpoint,EurekaEndpointGroup,HealthCheckedEndpointGroup,KubernetesEndpointGroup,PropertiesEndpointGroup,Server,StartStopSupport,XdsEndpointGroup,ZooKeeperEndpointGroup
An object that may hold resources until it is closed. In addition to
AutoCloseable.close(),
this interface provides closeAsync() which releases the resources asynchronously, returning
a CompletableFuture which is completed after the resources are released.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases any underlying resources held by this object synchronously.Releases any underlying resources held by this object asynchronously.
-
Method Details
-
closeAsync
CompletableFuture<?> closeAsync()Releases any underlying resources held by this object asynchronously.- Returns:
- the
CompletableFuturewhich is completed after the resources are released
-
close
void close()Releases any underlying resources held by this object synchronously.- Specified by:
closein interfaceAutoCloseable
-