public interface AsyncDistributedLock extends DistributedPrimitive
DistributedPrimitive.Status, DistributedPrimitive.Type
DEFAULT_OPERATION_TIMEOUT_MILLIS, DEFAULT_OPERTATION_TIMEOUT_MILLIS
Modifier and Type | Method and Description |
---|---|
default DistributedLock |
asLock() |
default DistributedLock |
asLock(long timeoutMillis) |
CompletableFuture<Version> |
lock()
Acquires the lock, blocking until it's available.
|
default DistributedPrimitive.Type |
primitiveType()
Returns the type of 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.
|
addStatusChangeListener, applicationId, destroy, name, removeStatusChangeListener, statusChangeListeners
default DistributedPrimitive.Type primitiveType()
DistributedPrimitive
primitiveType
in interface DistributedPrimitive
CompletableFuture<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 DistributedLock asLock()
default DistributedLock asLock(long timeoutMillis)