public interface AsyncDistributedCyclicBarrier extends AsyncPrimitive
DEFAULT_OPERATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Integer> |
await()
Waits until all parties have invoked await on this barrier.
|
CompletableFuture<Integer> |
await(Duration timeout)
Waits until all parties have invoked await on this barrier.
|
CompletableFuture<Integer> |
getNumberWaiting()
Returns the number of parties currently waiting at the barrier.
|
CompletableFuture<Integer> |
getParties()
Returns the number of parties required to trip this barrier.
|
CompletableFuture<Boolean> |
isBroken()
Returns whether this barrier is in a broken state.
|
CompletableFuture<Void> |
reset()
Resets the barrier to its initial state.
|
default DistributedCyclicBarrier |
sync()
Returns a synchronous wrapper around the asynchronous primitive.
|
DistributedCyclicBarrier |
sync(Duration operationTimeout)
Returns a synchronous wrapper around the asynchronous primitive.
|
close, deleteaddStateChangeListener, name, protocol, removeStateChangeListener, typeCompletableFuture<Integer> await()
getParties() - 1 indicates the first to
arrive and zero indicates the last to arriveCompletableFuture<Integer> await(Duration timeout)
timeout - the time to wait for the barriergetParties() - 1 indicates the first to
arrive and zero indicates the last to arriveCompletableFuture<Integer> getNumberWaiting()
CompletableFuture<Integer> getParties()
CompletableFuture<Boolean> isBroken()
CompletableFuture<Void> reset()
default DistributedCyclicBarrier sync()
AsyncPrimitivesync in interface AsyncPrimitiveDistributedCyclicBarrier sync(Duration operationTimeout)
AsyncPrimitivesync in interface AsyncPrimitiveoperationTimeout - the synchronous operation timeoutCopyright © 2013–2018. All rights reserved.