Interface AsyncWaiter<T>

Type Parameters:
T - the type of the resource returned from the polling function
All Known Implementing Classes:
DefaultAsyncWaiter

public interface AsyncWaiter<T>
Waiter utility class that waits for a resource to transition to the desired state asynchronously
  • Method Details

    • runAsync

      default CompletableFuture<WaiterResponse<T>> runAsync(Supplier<CompletableFuture<T>> asyncPollingFunction)
      Runs the provided polling function. It completes successfully when the resource enters into a desired state or exceptionally when it is determined that the resource will never enter into the desired state.
      Parameters:
      asyncPollingFunction - the polling function to trigger
      Returns:
      A CompletableFuture containing the WaiterResponse
    • runAsync

      default CompletableFuture<WaiterResponse<T>> runAsync(Supplier<CompletableFuture<T>> asyncPollingFunction, WaiterOverrideConfiguration overrideConfig)
      Runs the provided polling function. It completes successfully when the resource enters into a desired state or exceptionally when it is determined that the resource will never enter into the desired state.
      Parameters:
      asyncPollingFunction - the polling function to trigger
      overrideConfig - per request override configuration
      Returns:
      A CompletableFuture containing the WaiterResponse
    • runAsync

      default CompletableFuture<WaiterResponse<T>> runAsync(Supplier<CompletableFuture<T>> asyncPollingFunction, Consumer<WaiterOverrideConfiguration.Builder> overrideConfig)
      Runs the provided polling function. It completes successfully when the resource enters into a desired state or exceptionally when it is determined that the resource will never enter into the desired state.
      Parameters:
      asyncPollingFunction - the polling function to trigger
      overrideConfig - The consumer that will configure the per request override configuration for waiters
      Returns:
      A CompletableFuture containing the WaiterResponse
    • builder

      static <T> AsyncWaiter.Builder<T> builder(Class<? extends T> responseClass)
      Creates a newly initialized builder for the waiter object.
      Type Parameters:
      T - the type of the response
      Parameters:
      responseClass - the response class
      Returns:
      a Waiter builder