Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DocOptions

Constructor options for a document (CRuntime/AbstractDoc).

Hierarchy

  • DocOptions

Index

Properties

allowRedundantLoads?: boolean

If true, AbstractDoc.load/CRuntime.load always pass savedState to the Collabs and emit an Update event, even if savedState appears to be redundant.

Set this to true if loading is intentionally not idempotent (loading an already-applied transaction has a nontrivial effect), or if you want to test whether loading is idempotent.

A saved state "appears to be redundant" if all of its vector clock entries are <= our own. In that case, SavedStateEvent's vectorClock and redundant fields are deep-equal.

autoTransactions?: "microtask" | "error" | "debugOp"

How long transactions should be in the absence of a top-level CRuntime.transact/AbstractDoc.transact call:

  • "microtask" (default): All operations in the same microtask form a transaction (specifically, until Promise.resolve().then() executes).
  • "error": Throw an error if there is an operation outside a top-level transact call.
  • "debugOp": Each operation is its own transaction. This is not recommended except for testing or benchmarking, since individual Collabs may expect that sequential operations are delivered together.
causalityGuaranteed?: boolean

If you guarantee that messages will always be delivered to CRuntime.receive/AbstractDoc.receive in causal order, on all replicas (not just this one), you may set this to true to turn off causal ordering checks.

For example, this may be true if all messages pass through a central server that forwards them in the order it receives them.

CRuntime.receive/AbstractDoc.receive will still filter duplicate messages for you.

debugReplicaID?: string

For debugging/testing/benchmarking purposes, you may specify replicaID, typically using ReplicaIDs.pseudoRandom.

Otherwise, replicaID is randomly generated using ReplicaIDs.random.

Generated using TypeDoc