public interface AsyncAtomicLock extends AsyncPrimitive
DEFAULT_OPERATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Version> |
lock()
Acquires the lock, blocking until it's available.
|
default AtomicLock |
sync()
Returns a synchronous wrapper around the asynchronous primitive.
|
AtomicLock |
sync(Duration operationTimeout)
Returns a synchronous wrapper around the asynchronous primitive.
|
CompletableFuture<Optional<Version>> |
tryLock()
Attempts to acquire the lock.
|
CompletableFuture<Optional<Version>> |
tryLock(Duration timeout)
Attempts to acquire the lock for a specified amount of time.
|
CompletableFuture<Void> |
unlock()
Unlocks the lock.
|
close, deleteaddStateChangeListener, name, protocol, removeStateChangeListener, typeCompletableFuture<Version> lock()
CompletableFuture<Optional<Version>> tryLock()
CompletableFuture<Optional<Version>> tryLock(Duration timeout)
timeout - the timeout after which to give up attempting to acquire the lockCompletableFuture<Void> unlock()
default AtomicLock sync()
AsyncPrimitivesync in interface AsyncPrimitiveAtomicLock sync(Duration operationTimeout)
AsyncPrimitivesync in interface AsyncPrimitiveoperationTimeout - the synchronous operation timeoutCopyright © 2013–2018. All rights reserved.