Tests to see if loadBalancer has reached status. This class is most useful when paired with a RetryablePredicate as in the code below. This class can be used to block execution until the LoadBalancer status has reached a desired state. This is useful when your LoadBalancer needs to be 100% ready before you can continue with execution.
{@code LoadBalancer loadBalancer = loadBalancerApi.create(loadBalancerRequest); RetryablePredicate awaitAvailable = RetryablePredicate.create( LoadBalancerPredicates.available(loadBalancerApi), 600, 10, 10, TimeUnit.SECONDS);}if (!awaitAvailable.apply(loadBalancer)) throw new TimeoutException("Timeout on loadBalancer: " + loadBalancer); } }
You can also use the static convenience methods as so.
{@code LoadBalancer loadBalancer = loadBalancerApi.create(loadBalancerRequest);}if (!LoadBalancerPredicates.awaitAvailable(loadBalancerApi).apply(loadBalancer)) throw new TimeoutException("Timeout on loadBalancer: " + loadBalancer); } }
@author Everett Toews