vertx / io.vertx.kotlin.core.shareddata / io.vertx.core.shareddata.AsyncMap

Extensions for io.vertx.core.shareddata.AsyncMap

clearAwait

suspend fun <K, V> AsyncMap<K, V>.clearAwait(): Unit

Clear all entries in the map

getAwait

suspend fun <K, V> AsyncMap<K, V>.getAwait(k: K): V?

Get a value from the map, asynchronously.

putAwait

suspend fun <K, V> AsyncMap<K, V>.putAwait(k: K, v: V): Unit

Put a value in the map, asynchronously.

suspend fun <K, V> AsyncMap<K, V>.putAwait(k: K, v: V, ttl: Long): Unit

Like io.vertx.core.shareddata.AsyncMap but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.

putIfAbsentAwait

suspend fun <K, V> AsyncMap<K, V>.putIfAbsentAwait(k: K, v: V): V?

Put the entry only if there is no entry with the key already present. If key already present then the existing value will be returned to the handler, otherwise null.

suspend fun <K, V> AsyncMap<K, V>.putIfAbsentAwait(k: K, v: V, ttl: Long): V?

Link io.vertx.core.shareddata.AsyncMap but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.

removeAwait

suspend fun <K, V> AsyncMap<K, V>.removeAwait(k: K): V?

Remove a value from the map, asynchronously.

removeIfPresentAwait

suspend fun <K, V> AsyncMap<K, V>.removeIfPresentAwait(k: K, v: V): Boolean

Remove a value from the map, only if entry already exists with same value.

replaceAwait

suspend fun <K, V> AsyncMap<K, V>.replaceAwait(k: K, v: V): V?

Replace the entry only if it is currently mapped to some value

replaceIfPresentAwait

suspend fun <K, V> AsyncMap<K, V>.replaceIfPresentAwait(k: K, oldValue: V, newValue: V): Boolean

Replace the entry only if it is currently mapped to a specific value

sizeAwait

suspend fun <K, V> AsyncMap<K, V>.sizeAwait(): Int

Provide the number of entries in the map