vertx / io.vertx.reactivex.core.shareddata / Counter

Counter

open class Counter

An asynchronous counter that can be used to across the cluster to maintain a consistent count.

NOTE: This class has been automatically generated from the io.vertx.core.shareddata.Counter non RX-ified interface using Vert.x codegen.

Constructors

<init>

Counter(delegate: Counter)

Properties

__TYPE_ARG

static val __TYPE_ARG: TypeArg<Counter>

Functions

addAndGet

open fun addAndGet(value: Long, resultHandler: Handler<AsyncResult<Long>>): Unit

Add the value to the counter atomically and return the new count

compareAndSet

open fun compareAndSet(expected: Long, value: Long, resultHandler: Handler<AsyncResult<Boolean>>): Unit

Set the counter to the specified value only if the current value is the expectec value. This happens atomically.

decrementAndGet

open fun decrementAndGet(resultHandler: Handler<AsyncResult<Long>>): Unit

Decrement the counter atomically and return the new count

equals

open fun equals(other: Any?): Boolean

get

open fun get(resultHandler: Handler<AsyncResult<Long>>): Unit

Get the current value of the counter

getAndAdd

open fun getAndAdd(value: Long, resultHandler: Handler<AsyncResult<Long>>): Unit

Add the value to the counter atomically and return the value before the add

getAndIncrement

open fun getAndIncrement(resultHandler: Handler<AsyncResult<Long>>): Unit

Increment the counter atomically and return the value before the increment.

getDelegate

open fun getDelegate(): Counter

hashCode

open fun hashCode(): Int

incrementAndGet

open fun incrementAndGet(resultHandler: Handler<AsyncResult<Long>>): Unit

Increment the counter atomically and return the new count

newInstance

open static fun newInstance(arg: Counter): Counter

rxAddAndGet

open fun rxAddAndGet(value: Long): Single<Long>

Add the value to the counter atomically and return the new count

rxCompareAndSet

open fun rxCompareAndSet(expected: Long, value: Long): Single<Boolean>

Set the counter to the specified value only if the current value is the expectec value. This happens atomically.

rxDecrementAndGet

open fun rxDecrementAndGet(): Single<Long>

Decrement the counter atomically and return the new count

rxGet

open fun rxGet(): Single<Long>

Get the current value of the counter

rxGetAndAdd

open fun rxGetAndAdd(value: Long): Single<Long>

Add the value to the counter atomically and return the value before the add

rxGetAndIncrement

open fun rxGetAndIncrement(): Single<Long>

Increment the counter atomically and return the value before the increment.

rxIncrementAndGet

open fun rxIncrementAndGet(): Single<Long>

Increment the counter atomically and return the new count

toString

open fun toString(): String