public class GenericWaiter extends Object
Provides a basic waiter that will periodically poll for an update until a desired condition is met.
Constructor and Description |
---|
GenericWaiter(WaiterConfiguration waiterConfiguration) |
Modifier and Type | Method and Description |
---|---|
<REQUEST,RESPONSE> |
execute(com.google.common.base.Supplier<REQUEST> requestSupplier,
com.google.common.base.Function<REQUEST,RESPONSE> functionCall,
com.google.common.base.Predicate<RESPONSE> terminationPredicate)
Blocks until a specific condition is met.
|
WaiterConfiguration |
getWaiterConfiguration() |
@ConstructorProperties(value="waiterConfiguration") public GenericWaiter(WaiterConfiguration waiterConfiguration)
public <REQUEST,RESPONSE> com.google.common.base.Optional<RESPONSE> execute(com.google.common.base.Supplier<REQUEST> requestSupplier, com.google.common.base.Function<REQUEST,RESPONSE> functionCall, com.google.common.base.Predicate<RESPONSE> terminationPredicate)
Blocks until a specific condition is met.
REQUEST
- Request object classRESPONSE
- Response object classrequestSupplier
- Supplier that provides a new request instance to fetch the
current state.functionCall
- Function that will be invoked to fetch the current state. It
will be provided the request instance given by the
requestSupplier.terminationPredicate
- The termination predicate that will inspect the current state
(returned response instance) to determine if it is done
waiting.public WaiterConfiguration getWaiterConfiguration()
Copyright © 2016–2022. All rights reserved.