JournalExchangeOptions.sync
property · packages/sync/src/journal.ts:42
readonly sync: Sync<Message, Shared>The document's contract: its codecs, and the snapshot a checkpoint encodes.
Sync / foldkit-sync/journal
interface · packages/sync/src/journal.ts:40
interface JournalExchangeOptions<Message, Shared, Principal> {
readonly sync: Sync<Message, Shared>
readonly journal: Journal<Operation, Shared, Principal, Operation>
readonly principal: Principal
readonly settle?: Effect.Effect<void, unknown> | undefined
readonly opens?: Effect.Effect<boolean> | undefined
readonly admit?:
| ((
operation: Operation,
) => AuthorizeDecision | Effect.Effect<AuthorizeDecision, unknown>)
| undefined
readonly limit?: number | undefined
}JournalExchangeOptions.syncproperty · packages/sync/src/journal.ts:42
readonly sync: Sync<Message, Shared>The document's contract: its codecs, and the snapshot a checkpoint encodes.
JournalExchangeOptions.journalproperty · packages/sync/src/journal.ts:47
readonly journal: Journal<Operation, Shared, Principal, Operation>The journal made from sync.journalContract(), which orders and keeps the
document. One that takes any input, or only operations, is accepted.
JournalExchangeOptions.principalproperty · packages/sync/src/journal.ts:52
readonly principal: PrincipalWho is exchanging, as the transport established it. The journal's
authorize reads it; a refused operation is reported as rejected.
JournalExchangeOptions.settleproperty · packages/sync/src/journal.ts:58
readonly settle?: Effect.Effect<void, unknown> | undefinedRuns after each exchange's appends and before the reply is read: apply
what committed to another store, through journal.recover. It runs on
every exchange, so a write that failed is tried again on the next.
JournalExchangeOptions.opensproperty · packages/sync/src/journal.ts:64
readonly opens?: Effect.Effect<boolean> | undefinedWhether the connection may open the document at all, to read it or to change it: a principal outside its readers. Refused, every exchange fails, and nothing is read or appended.
JournalExchangeOptions.admitproperty · packages/sync/src/journal.ts:74
readonly admit?:
| ((
operation: Operation,
) => AuthorizeDecision | Effect.Effect<AuthorizeDecision, unknown>)
| undefinedWhether an operation may be appended, decided before the journal sees it,
by what the transport established rather than by the document: a principal
that may only read, or a rule that reads the rows an edit names, which
cannot run under the journal's lock (foldkit-guard/sync). true admits;
a refusal is rejected by the operation's id, with its reason when it gives
one. One that fails fails the exchange, as the journal failing does. The
journal's own authorize is where a rule about the document goes.
JournalExchangeOptions.limitproperty · packages/sync/src/journal.ts:78
readonly limit?: number | undefinedThe most committed operations one reply carries; a replica further behind asks again. Default 500.