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
- Alphabetic
- By Inheritance
- ReplicatedRegister
- InternalReplicatedData
- InternalReplicatedData
- ReplicatedData
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Type Members
- final type Self = ReplicatedRegister[T]
- Definition Classes
- ReplicatedRegister → InternalReplicatedData
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- 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
- 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()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- 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
java.util.NoSuchElementException
if value not defined
- final def applyDelta: PartialFunction[Delta, ReplicatedRegister[T]]
- Definition Classes
- ReplicatedRegister → InternalReplicatedData
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val delegate: ReplicatedRegisterImpl[T]
- Definition Classes
- ReplicatedRegister → InternalReplicatedData
- 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
- 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
- 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
- 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
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- 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
.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDelta: Delta
- Definition Classes
- InternalReplicatedData → InternalReplicatedData
- def hasDelta: Boolean
- Definition Classes
- InternalReplicatedData → InternalReplicatedData
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def name: String
- Definition Classes
- InternalReplicatedData → InternalReplicatedData
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def resetDelta(): ReplicatedRegister[T]
- Definition Classes
- ReplicatedRegister → InternalReplicatedData
- 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
- 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
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- 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 ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- 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.