vertx / io.vertx.core.shareddata

Package io.vertx.core.shareddata

Types

Shareable

interface Shareable

A marker interface which allows you to put arbitrary objects into a io.vertx.core.shareddata.LocalMap.

Normally local maps only allow immutable objects or other copiable objects such as io.vertx.core.buffer.Buffer instances in order to avoid shared access to mutable state.

However if you have an object that you know is thread-safe you can mark it with this interface and then you will be able to add it to io.vertx.core.shareddata.LocalMap instances.

Use this interface with caution.

SharedData

interface SharedData

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

Shared data provides:

  • synchronous shared maps (local)
  • asynchronous maps (local or cluster-wide)
  • asynchronous locks (local or cluster-wide)
  • asynchronous counters (local or cluster-wide)

WARNING: In clustered mode, asynchronous maps/locks/counters rely on distributed data structures provided by the cluster manager. Beware that the latency relative to asynchronous maps/locks/counters operations can be much higher in clustered than in local mode.

Please see the documentation for more information.