CRDTServerRegistryDocuments mixin

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

Looking a document up, applying a change, snapshotting and counting work the same on any storage.

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 setteroverride
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
snapshots → Stream<ServerSnapshot>
The snapshots the documents of this registry take, once stored.
no setteroverride

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