Interface AsyncWaiter<T>
-
- Type Parameters:
T- the type of the resource returned from the polling function
- All Known Implementing Classes:
DefaultAsyncWaiter
@SdkPublicApi public interface AsyncWaiter<T>
Waiter utility class that waits for a resource to transition to the desired state asynchronously
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAsyncWaiter.Builder<T>The Waiter Builder
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static <T> AsyncWaiter.Builder<T>builder(Class<? extends T> responseClass)Creates a newly initialized builder for the waiter object.default CompletableFuture<WaiterResponse<T>>runAsync(Supplier<CompletableFuture<T>> asyncPollingFunction)Runs the provided polling function.default CompletableFuture<WaiterResponse<T>>runAsync(Supplier<CompletableFuture<T>> asyncPollingFunction, Consumer<WaiterOverrideConfiguration.Builder> overrideConfig)Runs the provided polling function.default CompletableFuture<WaiterResponse<T>>runAsync(Supplier<CompletableFuture<T>> asyncPollingFunction, WaiterOverrideConfiguration overrideConfig)Runs the provided polling function.
-
-
-
Method Detail
-
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
CompletableFuturecontaining theWaiterResponse
-
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 triggeroverrideConfig- per request override configuration- Returns:
- A
CompletableFuturecontaining theWaiterResponse
-
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 triggeroverrideConfig- The consumer that will configure the per request override configuration for waiters- Returns:
- A
CompletableFuturecontaining theWaiterResponse
-
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
-
-