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
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> AsyncWaiter.Builder
<T> 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 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 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
CompletableFuture
containing 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
CompletableFuture
containing theWaiterResponse
-
builder
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
-