public interface AbstractAsyncLock<T extends AbstractAsyncLock.Token>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
AbstractAsyncLock.Token
A lock token indicating that the associated lock has been exclusively
acquired.
|
| Modifier and Type | Method and Description |
|---|---|
Promise<T> |
acquire()
Exclusively acquires this lock.
|
Optional<T> |
tryAcquire()
Attempts to immediately acquire the lock, returning a populated
Optional if the lock is
not currently held. |
Optional<T> tryAcquire()
Optional if the lock is
not currently held.Optional holding a AbstractAsyncLock.Token if the lock is not held; otherwise an
empty OptionalPromise<T> acquire()
The AbstractAsyncLock.Token held by the returned stage is used to release the
lock after it has been acquired and the lock-protected action has
completed.
Promise which will complete with a
AbstractAsyncLock.Token when the lock has been exclusively acquiredCopyright © 2021. All rights reserved.