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.
Constructor and description |
---|
SharedData
(java.lang.Object delegate) |
Type | Name and description |
---|---|
void |
getClusterWideMap(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<AsyncMap<K, V>>> resultHandler) Get the cluster wide map with the specified name. |
void |
getCounter(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<Counter>> resultHandler) Get a cluster wide counter. |
java.lang.Object |
getDelegate() |
LocalMap<K, V> |
getLocalMap(java.lang.String name) Return a LocalMap with the specific name . |
void |
getLock(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<Lock>> resultHandler) Get a cluster wide lock with the specified name. |
void |
getLockWithTimeout(java.lang.String name, long timeout, io.vertx.core.Handler<io.vertx.core.AsyncResult<Lock>> resultHandler) Like SharedData.getLock but specifying a timeout. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
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.
name
- the name of the mapresultHandler
- the map will be returned asynchronously in this handlerGet a cluster wide counter. The counter will be passed to the handler.
name
- the name of the counter.resultHandler
- the handler Return a LocalMap
with the specific name
.
name
- the name of the mapGet a cluster wide lock with the specified name. The lock will be passed to the handler when it is available.
name
- the name of the lockresultHandler
- the handlerLike SharedData.getLock but specifying a timeout. If the lock is not obtained within the timeout a failure will be sent to the handler
name
- the name of the locktimeout
- the timeout in msresultHandler
- the handler