CRDTServerRegistryDocuments mixin

The part of a CRDTServerRegistry that does not depend on where the documents are kept.

A registry differs in how it finds a document and what it does once one has snapshotted. Looking one up, refusing an id it does not serve, and deciding which failures of applyChange a client is told about are the same everywhere — and they were written twice before this existed, with two different error messages and no way to keep them in step.

Mix it in and give getDocument; override afterSnapshot when the snapshot has somewhere to go.

Implemented types
Mixin applications

Properties

documentCount Future<int>
Get the number of documents registered
no setterinherited
documentIds Future<Set<String>>
Get all document IDs
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addDocument(String documentId, {PeerId? author}) Future<void>
Register a document
inherited
afterSnapshot(String documentId, Snapshot snapshot) Future<void>
Runs once documentId has snapshotted, before createSnapshot returns.
applyChange(String documentId, Change change) Future<bool>
Applies change to documentId and returns whether it was new.
override
close() Future<void>
Lets go of everything this registry holds open.
inherited
createSnapshot(String documentId) Future<Snapshot>
Snapshots documentId and hands the snapshot to afterSnapshot.
override
getDocument(String documentId) Future<CRDTDocument?>
Get a store for an existing document
inherited
getLatestSnapshot(String documentId) Future<Snapshot?>
Get the latest snapshot of a document
inherited
hasDocument(String documentId) Future<bool>
Check if a document exists
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeDocument(String documentId) Future<void>
Remove a document
inherited
requireDocument(String documentId) Future<CRDTDocument>
The document documentId holds, or throws ArgumentError when this registry does not serve it.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited