vertx / io.vertx.core.shareddata / SharedData

SharedData

interface SharedData

Shared data allows you to share data safely between different parts of your application in a safe way.

Shared data provides:

Please see the documentation for more information.

Author
Tim Fox

Functions

getClusterWideMap

abstract fun <K : Any, V : Any> getClusterWideMap(name: String, resultHandler: Handler<AsyncResult<AsyncMap<K, V>>>): Unit

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.

getCounter

abstract fun getCounter(name: String, resultHandler: Handler<AsyncResult<Counter>>): Unit

Get a cluster wide counter. The counter will be passed to the handler.

getLocalMap

abstract fun <K : Any, V : Any> getLocalMap(name: String): LocalMap<K, V>

Return a LocalMap with the specific name.

getLock

abstract fun getLock(name: String, resultHandler: Handler<AsyncResult<Lock>>): Unit

Get a cluster wide lock with the specified name. The lock will be passed to the handler when it is available.

getLockWithTimeout

abstract fun getLockWithTimeout(name: String, timeout: Long, resultHandler: Handler<AsyncResult<Lock>>): Unit

Like #getLock(String, Handler) but specifying a timeout. If the lock is not obtained within the timeout a failure will be sent to the handler