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)
Counter
public void incrementAndGet(Handler<AsyncResult<Long>> resultHandler)
Counter
incrementAndGet
in interface Counter
resultHandler
- handler which will be passed the valuepublic void getAndIncrement(Handler<AsyncResult<Long>> resultHandler)
Counter
getAndIncrement
in interface Counter
resultHandler
- handler which will be passed the valuepublic void decrementAndGet(Handler<AsyncResult<Long>> resultHandler)
Counter
decrementAndGet
in interface Counter
resultHandler
- handler which will be passed the valuepublic void addAndGet(long value, Handler<AsyncResult<Long>> resultHandler)
Counter
public void getAndAdd(long value, Handler<AsyncResult<Long>> resultHandler)
Counter
public void compareAndSet(long expected, long value, Handler<AsyncResult<Boolean>> resultHandler)
Counter
compareAndSet
in interface Counter
expected
- the expected valuevalue
- the new valueresultHandler
- the handler will be passed true on successCopyright © 2015. All Rights Reserved.