Interface Awaitable
- All Known Subinterfaces:
Condition,ConditionAsConsumer<T>,CountDownLatch,Future<V>,Promise<V>,RunnableFuture<V>,WaitQueue.Signal
- All Known Implementing Classes:
AbstractFuture,AsymmetricRemoteSyncTask,AsyncChannelPromise,AsyncFuture,AsyncOneResponse,AsyncPromise,AsyncPromise.WithExecutor,Awaitable.AbstractAwaitable,Awaitable.AsyncAwaitable,Awaitable.SyncAwaitable,BlockingPartitionRepair,Condition.Async,Condition.Sync,ConditionAsConsumer.Async,CountDownLatch.Async,CountDownLatch.Sync,FutureCombiner,FutureTask,FutureTaskWithResources,ImmediateFuture,LocalSyncTask,PaxosCleanup,PaxosCleanupComplete,PaxosCleanupLocalCoordinator,PaxosCleanupSession,PaxosFinishPrepareCleanup,PaxosStartPrepareCleanup,RepairJob,RepairSession,Scheduler.Task,SnapshotTask,StreamResultFuture,SymmetricRemoteSyncTask,SyncFuture,SyncFutureTask,SyncPromise,SyncPromise.WithExecutor,SyncTask,ValidationTask,WaitQueue.Standard.AbstractSignal
public interface Awaitable
A generic signal consumer, supporting all of the typical patterns used in Cassandra.
All of the methods defined in
Awaitable may be waited on without a loop,
as this interface declares that there are no spurious wake-ups.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionawait()Await indefinitely, throwing any interrupt.booleanAwait for the specified period, throwing any interrupt.Await indefinitely, throwing any interrupt as an unchecked exception.booleanawaitThrowUncheckedOnInterrupt(long time, TimeUnit units) Await for the specified period, throwing any interrupt as an unchecked exception.Await indefinitely, ignoring interrupts (but maintaining the interrupt flag on exit).booleanawaitUninterruptibly(long time, TimeUnit units) Await until the deadline (in nanoTime), ignoring interrupts (but maintaining the interrupt flag on exit).booleanawaitUntil(long nanoTimeDeadline) Await until the deadline (in nanoTime), throwing any interrupt.booleanawaitUntilThrowUncheckedOnInterrupt(long nanoTimeDeadline) Await until the deadline (in nanoTime), throwing any interrupt as an unchecked exception.booleanawaitUntilUninterruptibly(long nanoTimeDeadline) Await until the deadline (in nanoTime), ignoring interrupts (but maintaining the interrupt flag on exit).
-
Method Details
-
awaitUntil
Await until the deadline (in nanoTime), throwing any interrupt. No spurious wakeups.- Returns:
- true if we were signalled, false if the deadline elapsed
- Throws:
InterruptedException- if interrupted
-
awaitUntilThrowUncheckedOnInterrupt
boolean awaitUntilThrowUncheckedOnInterrupt(long nanoTimeDeadline) throws UncheckedInterruptedException Await until the deadline (in nanoTime), throwing any interrupt as an unchecked exception. No spurious wakeups.- Returns:
- true if we were signalled, false if the deadline elapsed
- Throws:
UncheckedInterruptedException- if interrupted
-
awaitUntilUninterruptibly
boolean awaitUntilUninterruptibly(long nanoTimeDeadline) Await until the deadline (in nanoTime), ignoring interrupts (but maintaining the interrupt flag on exit). No spurious wakeups.- Returns:
- true if we were signalled, false if the deadline elapsed
-
await
Await for the specified period, throwing any interrupt. No spurious wakeups.- Returns:
- true if we were signalled, false if the timeout elapses
- Throws:
InterruptedException- if interrupted
-
awaitThrowUncheckedOnInterrupt
boolean awaitThrowUncheckedOnInterrupt(long time, TimeUnit units) throws UncheckedInterruptedException Await for the specified period, throwing any interrupt as an unchecked exception. No spurious wakeups.- Returns:
- true if we were signalled, false if the timeout elapses
- Throws:
UncheckedInterruptedException- if interrupted
-
awaitUninterruptibly
Await until the deadline (in nanoTime), ignoring interrupts (but maintaining the interrupt flag on exit). No spurious wakeups.- Returns:
- true if we were signalled, false if the timeout elapses
-
await
Await indefinitely, throwing any interrupt. No spurious wakeups.- Throws:
InterruptedException- if interrupted
-
awaitThrowUncheckedOnInterrupt
Await indefinitely, throwing any interrupt as an unchecked exception. No spurious wakeups.- Throws:
UncheckedInterruptedException- if interrupted
-
awaitUninterruptibly
Awaitable awaitUninterruptibly()Await indefinitely, ignoring interrupts (but maintaining the interrupt flag on exit). No spurious wakeups.
-