API Reference / @evolu/common / Evolu/Protocol / createProtocolMessageFromCrdtMessages

Function: createProtocolMessageFromCrdtMessages()

function createProtocolMessageFromCrdtMessages(deps): (owner, messages, maxSize?) => ProtocolMessage;

Defined in: packages/common/src/Evolu/Protocol.ts:417

Creates a ProtocolMessage from CRDT messages.

If the message size would exceed maxProtocolMessageSize, the protocol ensures all messages will be sent in the next round(s) even over unidirectional and stateless transports.

Parameters

ParameterType
depsSymmetricCryptoDep & CreateRandomBytesDep

Returns

(
   owner, 
   messages, 
   maxSize?): ProtocolMessage;

Parameters

ParameterType
ownerOwnerWithWriteAccess
messagesreadonly [CrdtMessage, CrdtMessage]
maxSize?number & Brand<"Int"> & Brand<"NonNegative"> & Brand<"Positive">

Returns

ProtocolMessage

Was this page helpful?