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
public abstract static class Awaitable.AsyncAwaitable extends Awaitable.AbstractAwaitable
A barebones asynchronousAwaitable
. 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 Modifier Constructor Description protected
AsyncAwaitable()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Awaitable
await()
boolean
awaitUntil(long nanoTimeDeadline)
protected abstract boolean
isSignalled()
Return true once signalled.protected void
signal()
Signal any waiting threads;isSignalled()
must returntrue
before this method is invoked.-
Methods inherited from class org.apache.cassandra.utils.concurrent.Awaitable.AbstractAwaitable
await, awaitThrowUncheckedOnInterrupt, awaitThrowUncheckedOnInterrupt, awaitUninterruptibly, awaitUninterruptibly, awaitUntilThrowUncheckedOnInterrupt, awaitUntilUninterruptibly
-
-
-
-
Method Detail
-
await
public Awaitable await() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
- if interrupted
-
awaitUntil
public boolean awaitUntil(long nanoTimeDeadline) throws java.lang.InterruptedException
- Returns:
- true if we were signalled, false if the deadline elapsed
- Throws:
java.lang.InterruptedException
- if interrupted
-
signal
protected void signal()
Signal any waiting threads;isSignalled()
must returntrue
before this method is invoked.
-
isSignalled
protected abstract boolean isSignalled()
Return true once signalled. Unidirectional; once true, must never again be false.
-
-