class ReplicatedRegister[T] extends InternalReplicatedData

A Last-Write-Wins Register.

This uses a clock value to determine which of two concurrent writes should win. When both clock values are the same, an ordering defined over the node addresses is used to break the tie.

By default, the clock used is the clock of the node that set the value. This can be affected by clock skew, which means two successive writes delegated to two separate nodes could result in the first one winning. This can be avoided by using a custom clock with a domain specific clock value, if such a causally ordered value is available.

Source
ReplicatedRegister.scala
Linear Supertypes
InternalReplicatedData, javasdk.impl.replicatedentity.InternalReplicatedData, ReplicatedData, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReplicatedRegister
  2. InternalReplicatedData
  3. InternalReplicatedData
  4. ReplicatedData
  5. AnyRef
  6. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final type Self = ReplicatedRegister[T]
    Definition Classes
    ReplicatedRegister → InternalReplicatedData

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from ReplicatedRegister[T] toany2stringadd[ReplicatedRegister[T]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ReplicatedRegister[T], B)
    Implicit
    This member is added by an implicit conversion from ReplicatedRegister[T] toArrowAssoc[ReplicatedRegister[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def apply(): T

    Get the current value of the register.

    Get the current value of the register.

    returns

    the current value of the register

    Exceptions thrown

    NoSuchElementException if value not defined

  7. final def applyDelta: PartialFunction[Delta, ReplicatedRegister[T]]
    Definition Classes
    ReplicatedRegister → InternalReplicatedData
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. val delegate: ReplicatedRegisterImpl[T]
  11. def ensuring(cond: (ReplicatedRegister[T]) => Boolean, msg: => Any): ReplicatedRegister[T]
    Implicit
    This member is added by an implicit conversion from ReplicatedRegister[T] toEnsuring[ReplicatedRegister[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: (ReplicatedRegister[T]) => Boolean): ReplicatedRegister[T]
    Implicit
    This member is added by an implicit conversion from ReplicatedRegister[T] toEnsuring[ReplicatedRegister[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean, msg: => Any): ReplicatedRegister[T]
    Implicit
    This member is added by an implicit conversion from ReplicatedRegister[T] toEnsuring[ReplicatedRegister[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean): ReplicatedRegister[T]
    Implicit
    This member is added by an implicit conversion from ReplicatedRegister[T] toEnsuring[ReplicatedRegister[T]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  17. def get: Option[T]

    Optionally returns the current value of the register.

    Optionally returns the current value of the register.

    returns

    an option value containing the current value of the register if initialize, or None.

  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. def getDelta: Delta
    Definition Classes
    InternalReplicatedData → InternalReplicatedData
  20. def hasDelta: Boolean
    Definition Classes
    InternalReplicatedData → InternalReplicatedData
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def name: String
    Definition Classes
    InternalReplicatedData → InternalReplicatedData
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. final def resetDelta(): ReplicatedRegister[T]
    Definition Classes
    ReplicatedRegister → InternalReplicatedData
  28. def set(value: T, clock: Clock, customClockValue: Long): ReplicatedRegister[T]

    Set the current value of the register, using the given custom clock and clock value if required.

    Set the current value of the register, using the given custom clock and clock value if required.

    value

    the new value of the register

    clock

    the clock to use for replication

    customClockValue

    the custom clock value to use, only if it's a custom clock

    returns

    a new register with updated value

  29. def set(value: T): ReplicatedRegister[T]

    Set the value of the register, using the default clock.

    Set the value of the register, using the default clock.

    value

    the new value of the register

    returns

    a new register with updated value

  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from ReplicatedRegister[T] toStringFormat[ReplicatedRegister[T]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (ReplicatedRegister[T], B)
    Implicit
    This member is added by an implicit conversion from ReplicatedRegister[T] toArrowAssoc[ReplicatedRegister[T]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from InternalReplicatedData

Inherited from javasdk.impl.replicatedentity.InternalReplicatedData

Inherited from ReplicatedData

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromReplicatedRegister[T] to any2stringadd[ReplicatedRegister[T]]

Inherited by implicit conversion StringFormat fromReplicatedRegister[T] to StringFormat[ReplicatedRegister[T]]

Inherited by implicit conversion Ensuring fromReplicatedRegister[T] to Ensuring[ReplicatedRegister[T]]

Inherited by implicit conversion ArrowAssoc fromReplicatedRegister[T] to ArrowAssoc[ReplicatedRegister[T]]

Ungrouped