Sometimes it is desirable to share immutable data between different event loops, for example to implement a
cache of data.
Sometimes it is desirable to share immutable data between different event loops, for example to implement a
cache of data.
This class allows instances of shared data structures to be looked up and used from different event loops.
The data structures themselves will only allow certain data types to be stored into them. This shields you from
worrying about any thread safety issues might occur if mutable objects were shared between event loops.
The following types can be stored in a shareddata data structure:
[[java.lang.String]]
[[java.lang.Integer]]
[[java.lang.Long]]
[[java.lang.Double]]
[[java.lang.Float]]
[[java.lang.Short]]
[[java.lang.Byte]]
[[java.lang.Character]]
`byte[]` - this will be automatically copied, and the copy will be stored in the structure.
[[org.vertx.scala.core.buffer.Buffer]] - this will be automatically copied, and the copy will be stored in the
structure.
Sometimes it is desirable to share immutable data between different event loops, for example to implement a cache of data.
This class allows instances of shared data structures to be looked up and used from different event loops.
The data structures themselves will only allow certain data types to be stored into them. This shields you from worrying about any thread safety issues might occur if mutable objects were shared between event loops.
The following types can be stored in a shareddata data structure:
Instances of this class are thread-safe.