Class Awaitable.AsyncAwaitable
java.lang.Object
org.apache.cassandra.utils.concurrent.Awaitable.AbstractAwaitable
org.apache.cassandra.utils.concurrent.Awaitable.AsyncAwaitable
- All Implemented Interfaces:
Awaitable
- Direct Known Subclasses:
Condition.Async,CountDownLatch.Async
- Enclosing interface:
- Awaitable
A barebones asynchronous
Awaitable.
If your state is minimal, or can be updated concurrently, extend this class.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.concurrent.Awaitable
Awaitable.AbstractAwaitable, Awaitable.AsyncAwaitable, Awaitable.Defaults, Awaitable.SyncAwaitable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionawait()booleanawaitUntil(long nanoTimeDeadline) protected abstract booleanReturn true once signalled.protected voidsignal()Signal any waiting threads;isSignalled()must returntruebefore this method is invoked.Methods inherited from class org.apache.cassandra.utils.concurrent.Awaitable.AbstractAwaitable
await, awaitThrowUncheckedOnInterrupt, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUninterruptibly, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptibly
-
Constructor Details
-
AsyncAwaitable
protected AsyncAwaitable()
-
-
Method Details
-
await
- Throws:
InterruptedException- if interrupted
-
awaitUntil
- Returns:
- true if we were signalled, false if the deadline elapsed
- Throws:
InterruptedException- if interrupted
-
signal
protected void signal()Signal any waiting threads;isSignalled()must returntruebefore this method is invoked. -
isSignalled
protected abstract boolean isSignalled()Return true once signalled. Unidirectional; once true, must never again be false.
-