stdx.crdt
Members list
Type members
Experimental classlikes
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
DebugLevel.type
Attributes
- Experimental
- true
- Supertypes
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
HLC.type
Attributes
- Experimental
- true
- Supertypes
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ItemState.type
Operations either insert new content at some position (index), or delete the item at some position.
Operations either insert new content at some position (index), or delete the item at some position.
Note the positions are normal array / string indexes, indexing into what the document looked like when the operation was created (at its parent version).
Operations also have an ID (agent,seq pair) and a list of parent versions. In this implementation, the ID and parents are stored separately - in the causal graph.
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- object
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
OpId.type
Attributes
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
TimeMethod.type
Attributes
- Companion
- object
- Experimental
- true
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object given_TimeMethod
Attributes
- Experimental
- true
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Value members
Experimental methods
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
This function is called when we process insert operations to find (via a scan) the correct location in the item list to insert the new item. The location is passed back to the caller via the (modified) cursor.
This function is called when we process insert operations to find (via a scan) the correct location in the item list to insert the new item. The location is passed back to the caller via the (modified) cursor.
Some history:
This algorithm started its life in Yjs, written by Kevin Jahns. I adapted that approach for reference-crdts. Then modified & improved it in place to make YjsMod.
Then an almost identical algorithm was invented by Matthew Weidner and Kleppmann and called Fugue. The fugue paper proves many nice properties about this algorithm - in particular, it proves that it has excellent interleaving behaviour:
https://arxiv.org/abs/2305.00583
Meanwhile, Greg Little and Micheal Toomim wrote a seperate sequence CRDT algorithm called Sync9. Sync9 predated fugue by a couple of years. It was formulated a different way (using trees), but it turns out the ordering behaviour between sync9 and fugue is identical.
It also turns out that Fugue has one little problem in its interleaving behaviour, which was fixed by Weidner and named FugueMax. My YjsMod algorithm is (I think) identical to FugueMax, and that's what I've implemented here.
Anyway, the long and short of it is: This function implements the YjsMod / FugueMax CRDT - which is coincidentally very similar to Toomim & Little's Sync9.
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Attributes
- Experimental
- true
This function adds everything in the src oplog to dest
This function adds everything in the src oplog to dest
Attributes
- Experimental
- true
Add an operation to the oplog. Content is required if the operation is an insert.
Add an operation to the oplog. Content is required if the operation is an insert.
Attributes
- Experimental
- true
Attributes
- Experimental
- true
Traverse and apply the operations in the oplog.
Traverse and apply the operations in the oplog.
This function runs the core merging logic, traversing the graph of changes and modifying 2 structures along the way:
- The ctx.items will have fugue style items inserted, and their state changed.
- The passed in data array (document snapshot) will be modified.
Value parameters
- ctx
-
The (in memory) editing context with fugue items at some state
- fromOp
-
The index of the first operation to traverse over
- oplog
-
The log of operations we're applying
- snapshot
-
The document snapshot to modify. When the function returns, this contains the final document state.
- toOp
-
The bound on the indexes to traverse over
Attributes
- Experimental
- true