org.vertx.scala.core.shareddata

SharedData

final class SharedData extends AnyVal

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.

Instances of this class are thread-safe.

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SharedData
  2. AnyVal
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  2. final def ##(): Int

    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. val asJava: java.core.shareddata.SharedData

  6. def getClass(): Class[_ <: AnyVal]

    Definition Classes
    AnyVal → Any
  7. def getMap[K, V](name: String): Map[K, V]

    Return a scala.collection.concurrent.Map facade for the internal map with the specific name.

    Return a scala.collection.concurrent.Map facade for the internal map with the specific name. All invocations of this method with the same value of name are guaranteed to return the same underlying internal map instance.

    This method converts a Java collection into a Scala collection every time it gets called, so use it sensibly.

  8. def getSet[E](name: String): Set[E]

    Return a scala.collection.mutable.Set facade for the internal set with the specific name.

    Return a scala.collection.mutable.Set facade for the internal set with the specific name. All invocations of this method with the same value of name are guaranteed to return the same underlying internal set instance.

    This method converts a Java collection into a Scala collection every time it gets called, so use it sensibly.

  9. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  10. def removeMap(name: String): Boolean

    Remove the Map with the specific name.

  11. def removeSet(name: String): Boolean

    Remove the Set with the specific name.

  12. def toString(): String

    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped