RelaySocketClient class abstract
Interface for a relay client.
A relay client syncs a CRDTDocument through a relay server that never
interprets CRDT data: the relay persists and rebroadcasts opaque change
blobs, and merging happens entirely on the clients.
Deviations from the CRDTSocketClient contract:
- CRDTSocketClient.sendChange enqueues the change and delivers it at-least-once: the change leaves the queue only when the relay acknowledges it. Local document changes are enqueued automatically.
- CRDTSocketClient.requestSync asks the relay for the persisted room
state, which is merged into the document (
merge: true). - CRDTSocketClient.sessionId is assigned by the relay on join and is
nullwhile disconnected.
- Inheritance
-
- Object
- CRDTSocketClient
- RelaySocketClient
- Implementers
Constructors
-
RelaySocketClient({List<
ClientSyncPlugin> ? plugins}) - Constructor
Properties
-
The peer ID
no setterinherited
-
connectionStatus
→ Stream<
ConnectionStatus> -
Stream of connection status changes between client and server
no setterinherited
- connectionStatusValue → ConnectionStatus
-
The current connection status
no setterinherited
- document → CRDTDocument
-
The local CRDT document
no setterinherited
- 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 (
0before the first welcome).no setter -
messages
→ Stream<
Message> -
Stream of incoming server messages
no setterinherited
- pendingChangesCount → int
-
Number of local change blobs not yet acknowledged by the relay.
no setter
-
plugins
→ List<
ClientSyncPlugin> -
The client plugins
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sessionId → String?
-
The session ID
no setterinherited
Methods
-
connect(
) → Future< bool> -
Connect the client to the server
inherited
-
disconnect(
) → Future< void> -
Disconnect the client from the server
inherited
-
dispose(
) → void -
Dispose the client
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requestSync(
) → Future< void> -
Request a sync message from the server
inherited
-
sendChange(
Change change) → Future< void> -
Send a
Changeto the serverinherited -
sendMessage(
Message message) → Future< void> -
Send a Message to the server
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited