V - value typepublic interface AsyncDistributedValue<V> extends AsyncPrimitive
DEFAULT_OPERATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
addListener(ValueEventListener<V> listener)
Registers the specified listener to be notified whenever the atomic value is updated.
|
CompletableFuture<V> |
get()
Gets the current value.
|
CompletableFuture<V> |
getAndSet(V value)
Atomically sets to the given value and returns the old value.
|
CompletableFuture<Void> |
removeListener(ValueEventListener<V> listener)
Unregisters the specified listener such that it will no longer
receive atomic value update notifications.
|
CompletableFuture<Void> |
set(V value)
Sets to the given value.
|
default DistributedValue<V> |
sync()
Returns a synchronous wrapper around the asynchronous primitive.
|
DistributedValue<V> |
sync(Duration operationTimeout)
Returns a synchronous wrapper around the asynchronous primitive.
|
close, deleteaddStateChangeListener, name, protocol, removeStateChangeListener, typeCompletableFuture<V> get()
CompletableFuture<V> getAndSet(V value)
value - the new valueCompletableFuture<Void> set(V value)
value - value to setCompletableFuture<Void> addListener(ValueEventListener<V> listener)
listener - listener to notify about eventsCompletableFuture<Void> removeListener(ValueEventListener<V> listener)
listener - listener to unregisterdefault DistributedValue<V> sync()
AsyncPrimitivesync in interface AsyncPrimitiveDistributedValue<V> sync(Duration operationTimeout)
AsyncPrimitivesync in interface AsyncPrimitiveoperationTimeout - the synchronous operation timeoutCopyright © 2013–2018. All rights reserved.