sync library

Server–client mode of crdt_socket_sync on a Dart Frog backend.

The HTTP server stays Dart Frog's; each upgraded socket is handed to a DocumentSessionHost, which holds the documents and takes the aligned snapshots.

Classes

CRDTServerRegistry
Class managing the CRDT document registry on the server.
DocumentSessionHost
CRDT-aware session host: the server half of the document sync protocol, with no transport of its own.
SessionHostServer<S extends ClientSession>
A CRDTSocketServer that owns sessions, not a socket.
WebSocketChannelConnection
TransportConnection over a WebSocketChannel.

Enums

SessionHostState
The lifecycle of a SessionHostServer.

Functions

crdtSyncHostProvider(DocumentSessionHost host) → Middleware
Middleware that gives the routes below it host.
crdtSyncWebSocketHandler(DocumentSessionHost host, {Iterable<String>? protocols, Iterable<String>? allowedOrigins, Duration? pingInterval}) → Handler
A Dart Frog Handler that upgrades the request and hands the socket to host, the CRDT-aware (DocumentSessionHost) side of the protocol.