ResettableCounter

rdts.datatypes.alternatives.ResettableCounter
See theResettableCounter companion object
case class ResettableCounter(inner: Map[Dot, (Int, Int)])

An ResettableCounter (Resettable Counter/Add Wins Counter) is a Delta CRDT modeling a counter.

Calling fresh after every time that deltas are shipped to other replicas prevents subsequent increment/decrement operations to be overwritten by concurrent reset operations.

This counter was originally proposed by Baquera et al. in "The problem with embedded CRDT counters and a solution", see here

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Type members

Value members

Concrete methods

def decrement(using LocalUid)()(using context: Dots): Delta
def fresh(using LocalUid)()(using context: Dots): Delta

Without using fresh, reset wins over concurrent increments/decrements When using fresh after every time deltas are shipped to other replicas, increments/decrements win over concurrent resets

Without using fresh, reset wins over concurrent increments/decrements When using fresh after every time deltas are shipped to other replicas, increments/decrements win over concurrent resets

Attributes

def increment(using LocalUid)()(using context: Dots): Delta
def reset(): Delta
def value: Int

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product