vertx / io.vertx.kotlin.core.shareddata / io.vertx.core.shareddata.SharedData

Extensions for io.vertx.core.shareddata.SharedData

getAsyncMapAwait

suspend fun <K, V> SharedData.getAsyncMapAwait(name: String): AsyncMap<K, V>

Get the io.vertx.core.shareddata.AsyncMap with the specified name. When clustered, the map is accessible to all nodes in the cluster and data put into the map from any node is visible to to any other node.

getClusterWideMapAwait

suspend fun <K, V> SharedData.getClusterWideMapAwait(name: String): AsyncMap<K, V>

Get the cluster wide map with the specified name. The map is accessible to all nodes in the cluster and data put into the map from any node is visible to to any other node.

getCounterAwait

suspend fun SharedData.getCounterAwait(name: String): Counter

Get an asynchronous counter. The counter will be passed to the handler.

getLockAwait

suspend fun SharedData.getLockAwait(name: String): Lock

Get an asynchronous lock with the specified name. The lock will be passed to the handler when it is available.

getLockWithTimeoutAwait

suspend fun SharedData.getLockWithTimeoutAwait(name: String, timeout: Long): Lock

Like io.vertx.core.shareddata.SharedData but specifying a timeout. If the lock is not obtained within the timeout a failure will be sent to the handler.