Sync / foldkit-sync/journal

serveJournal

function · packages/sync/src/journal.ts:240

function serveJournal<Message, Shared, Principal>(
  socket: SocketLike,
  options: JournalExchangeOptions<Message, Shared, Principal>,
): () => void

Serves one accepted socket over the journal: each exchange frame answered by journalExchange with the connection's principal, and a notice sent after each commit, so the replica hears of others' edits. Returns the stop.