Module: vertx/shared_data

vertx/shared_data

Sometimes it makes sense to allow different verticles instances to share data in a safe way. Vert.x allows simple Map and Set data structures to be shared between verticles.

There is a caveat: To prevent issues due to mutable data, vert.x only allows simple immutable types such as number, boolean and string or Buffer to be used in shared data. With a Buffer, it is automatically copied when retrieved from the shared data, so different verticle instances never see the same object instance.

Source:
See:

Methods

<static> getMap(name) → {Object}

Return a Map with the specific name. All invocations of this method with the same value of name are guaranteed to return the same Map instance.
Parameters:
Name Type Description
name string The name of the map
Source:
Returns:
The shared data map
Type
Object

<static> getSet(name) → {Array}

Return a Set with the specific name. All invocations of this method with the same value of name are guaranteed to return the same Set instance.
Parameters:
Name Type Description
name string The name of the set
Source:
Returns:
The shared data set
Type
Array