RelayStore class abstract

Pluggable, CRDT-agnostic persistence for relay rooms.

A relay room persists an append-only log of opaque change blobs plus, at most, one snapshot. The store never interprets the blobs: assembling them into a CRDT document is entirely a client concern.

The default implementation is InMemoryRelayStore.

Implementers

Constructors

RelayStore()

Properties

hashCode int
The hash code for this object.
no setterinherited
roomIds Future<Set<String>>
The ids of the rooms with persisted state
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

append(String roomId, List<String> blobs) Future<int>
Appends blobs in order to the roomId log, assigning one sequence number per blob. Returns the last assigned sequence number.
deleteRoom(String roomId) Future<void>
Deletes every trace of roomId
getSnapshot(String roomId) Future<RelaySnapshotRecord?>
The latest roomId snapshot, if any
lastSeq(String roomId) Future<int>
The last sequence number assigned for roomId (0 if none).
logLength(String roomId) Future<int>
The current roomId log length
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readLog(String roomId, {int afterSeq = 0}) Future<List<RelayLogEntry>>
The roomId log entries with a sequence number greater than afterSeq, ordered by sequence number.
saveSnapshot(String roomId, RelaySnapshotRecord snapshot) Future<void>
Stores snapshot as the latest roomId snapshot and deletes the log entries it covers (sequence number <= RelaySnapshotRecord.upToSeq).
toString() String
A string representation of this object.
inherited

Operators

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