| Constructor and Description |
|---|
AsynchronousCounter(VertxInternal vertx) |
AsynchronousCounter(VertxInternal vertx,
AtomicLong counter) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAndGet(long value,
Handler<AsyncResult<Long>> resultHandler)
Add the value to the counter atomically and return the new count
|
void |
compareAndSet(long expected,
long value,
Handler<AsyncResult<Boolean>> resultHandler)
Set the counter to the specified value only if the current value is the expectec value.
|
void |
decrementAndGet(Handler<AsyncResult<Long>> resultHandler)
Decrement the counter atomically and return the new count
|
void |
get(Handler<AsyncResult<Long>> resultHandler)
Get the current value of the counter
|
void |
getAndAdd(long value,
Handler<AsyncResult<Long>> resultHandler)
Add the value to the counter atomically and return the value before the add
|
void |
getAndIncrement(Handler<AsyncResult<Long>> resultHandler)
Increment the counter atomically and return the value before the increment.
|
void |
incrementAndGet(Handler<AsyncResult<Long>> resultHandler)
Increment the counter atomically and return the new count
|
public AsynchronousCounter(VertxInternal vertx)
public AsynchronousCounter(VertxInternal vertx, AtomicLong counter)
public void get(Handler<AsyncResult<Long>> resultHandler)
Counterpublic void incrementAndGet(Handler<AsyncResult<Long>> resultHandler)
CounterincrementAndGet in interface CounterresultHandler - handler which will be passed the valuepublic void getAndIncrement(Handler<AsyncResult<Long>> resultHandler)
CountergetAndIncrement in interface CounterresultHandler - handler which will be passed the valuepublic void decrementAndGet(Handler<AsyncResult<Long>> resultHandler)
CounterdecrementAndGet in interface CounterresultHandler - handler which will be passed the valuepublic void addAndGet(long value,
Handler<AsyncResult<Long>> resultHandler)
Counterpublic void getAndAdd(long value,
Handler<AsyncResult<Long>> resultHandler)
Counterpublic void compareAndSet(long expected,
long value,
Handler<AsyncResult<Boolean>> resultHandler)
CountercompareAndSet in interface Counterexpected - the expected valuevalue - the new valueresultHandler - the handler will be passed true on successCopyright © 2015. All Rights Reserved.