vertx / io.vertx.core.spi.cluster / AsyncMultiMap

AsyncMultiMap

interface AsyncMultiMap<K : Any, V : Any>

An asynchronous multi-map. A multi-map holds a Set of values against each key as opposed to a single value, as with a Map. A value appears only once for a key (no duplicated values for the same key). The cluster implementation should ensure that any entries placed in the map from any node are available on any node of the cluster.

Author
Tim Fox

Functions

add

abstract fun add(k: K, v: V, completionHandler: Handler<AsyncResult<Void>>): Unit

Add a value to the values for that key in the map.

get

abstract fun get(k: K, resultHandler: Handler<AsyncResult<ChoosableIterable<V>>>): Unit

Get the values from the map for the key. If the key isn't in the map, an empty ChoosableIterable must be returned.

remove

abstract fun remove(k: K, v: V, completionHandler: Handler<AsyncResult<Boolean>>): Unit

Remove a value from the values of that key in the map.

removeAllForValue

abstract fun removeAllForValue(v: V, completionHandler: Handler<AsyncResult<Void>>): Unit

Remove the specified value from all values found equals associated to all keys in the map.

removeAllMatching

abstract fun removeAllMatching(p: Predicate<V>, completionHandler: Handler<AsyncResult<Void>>): Unit

Remove values which satisfies the given predicate in all keys.