vertx / io.vertx.kotlin.core.shareddata / io.vertx.core.shareddata.Counter / compareAndSetAwait

compareAndSetAwait

suspend fun Counter.compareAndSetAwait(expected: Long, value: Long): Boolean

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

Parameters

expected - the expected value

value - the new value

resultHandler - the handler will be passed true on success