DocumentClientSession constructor
DocumentClientSession({
- required String id,
- required TransportConnection connection,
- required CRDTServerRegistry serverRegistry,
- Compressor? compressor,
- MessageCodec<
Message> ? messageCodec, - int? maxBufferSize,
- List<
ServerSyncPlugin> plugins = const [],
CRDT-aware client session on server.
Implements the document sync protocol on top of ClientSession: handshake with version vectors, applying incoming changes to the CRDTServerRegistry and answering document status requests.
Constructor
Implementation
DocumentClientSession({
required super.id,
required super.connection,
required CRDTServerRegistry serverRegistry,
super.compressor,
MessageCodec<Message>? messageCodec,
super.maxBufferSize,
super.plugins,
}) : _serverRegistry = serverRegistry,
super.base(
messageCodec: messageCodec ??
JsonMessageCodec<Message>(
toJson: (message) => message.toJson(),
fromJson: (json) =>
SyncMessage.fromJson(json) ?? Message.fromJson(json),
),
);