RelaySyncManager class

Keeps a CRDTDocument and a relay client in step.

It is responsible for:

  • enqueueing local document changes and pushing them to the relay with at-least-once delivery (RelayPendingQueue)
  • importing the room state served by the relay (welcome) and the rebroadcast changes of other clients
  • answering compaction requests with a snapshot upload that never covers log entries this client has not imported (RelaySeqTracker)

Constructors

RelaySyncManager({required CRDTDocument document, required RelaySocketClient client})
Keeps a CRDTDocument and a relay client in step.

Properties

client → RelaySocketClient
The relay client
final
document → CRDTDocument
The local CRDT document
final
hashCode → int
The hash code for this object.
no setterinherited
lastKnownSeq → int
The last relay log sequence number this client knows to have fully imported (0 before the first welcome).
no setter
pendingChangesCount → int
Number of local change blobs not yet acknowledged by the relay.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → Future<void>
Dispose the resources
enqueue(Change change) → void
Enqueues change for the relay and flushes.
flush() → Future<void>
Pushes every queued blob, if allowed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAck(RelayAckMessage message) → Future<void>
Handles the ack of a push: drops the acknowledged blobs and flushes what queued up in the meantime.
onChanges(RelayChangesMessage message) → void
Imports change blobs rebroadcast by the relay.
onConnectionLost() → void
Marks the connection as lost.
onWelcome(RelayWelcomeMessage message) → Future<bool>
Imports the room state of a welcome, then queues everything the relay does not hold.
requestState() → Future<void>
Sends a state request; the relay answers with a welcome carrying the current persisted room state.
toString() → String
A string representation of this object.
inherited
uploadSnapshot(int requestedSeq) → Future<void>
Uploads a snapshot to compact the room log.

Operators

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