Interface AsyncCloseable

  • 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 AsyncCloseable
    An object that may hold resources until it is closed. Unlike AutoCloseable, the closeAsync() method releases the resources asynchronously, returning the CompletableFuture which is completed after the resources are released.
    • Method Detail

      • closeAsync

        CompletableFuture<?> closeAsync()
        Releases the resources held by this object asynchronously.
        Returns:
        the CompletableFuture which is completed after the resources are released