public interface AsyncDistributedCounter extends AsyncPrimitive
DEFAULT_OPERATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Long> |
addAndGet(long delta)
Atomically adds the given value to the current value.
|
CompletableFuture<Long> |
decrementAndGet()
Atomically decrement by one and return the updated value.
|
CompletableFuture<Long> |
get()
Returns the current value of the counter without modifying it.
|
CompletableFuture<Long> |
getAndAdd(long delta)
Atomically adds the given value to the current value.
|
CompletableFuture<Long> |
getAndDecrement()
Atomically decrement by one and return the previous value.
|
CompletableFuture<Long> |
getAndIncrement()
Atomically increment by one and return the previous value.
|
CompletableFuture<Long> |
incrementAndGet()
Atomically increment by one and return the updated value.
|
default DistributedCounter |
sync()
Returns a synchronous wrapper around the asynchronous primitive.
|
DistributedCounter |
sync(Duration operationTimeout)
Returns a synchronous wrapper around the asynchronous primitive.
|
close, deleteaddStateChangeListener, name, protocol, removeStateChangeListener, typeCompletableFuture<Long> incrementAndGet()
CompletableFuture<Long> decrementAndGet()
CompletableFuture<Long> getAndIncrement()
CompletableFuture<Long> getAndDecrement()
CompletableFuture<Long> getAndAdd(long delta)
delta - the value to addCompletableFuture<Long> addAndGet(long delta)
delta - the value to addCompletableFuture<Long> get()
default DistributedCounter sync()
AsyncPrimitivesync in interface AsyncPrimitiveDistributedCounter sync(Duration operationTimeout)
AsyncPrimitivesync in interface AsyncPrimitiveoperationTimeout - the synchronous operation timeoutCopyright © 2013–2018. All rights reserved.