openAsync.StdmoduleNext:sigtype'at=|Nextof'a|Endend(* * This represents a snapshot which is used to synchronize. * Snapshots are immutable and all synchornization returns * a list of operations to apply to the state machine. *)moduletypeS=sigtypettypeconttypechunktypeop(* * Create a starting point to synchrnoize. *)valstart:t->contDeferred.t(* * Take the current position in synchronization and give * back a chunk to synchronize and the next step in the * synchronization. *)valnext:cont->t->(chunk*cont)Next.tDeferred.t(* * sync takes a synchronization chunk and gives back * a list of operations to apply locally as well as an * optional chunk to send to the other node involved * in the sync to apply. If there is no chunk given back * it means the two nodes are synced. *)valsync:chunk->t->(oplist*chunkoption)Deferred.tend
openAsync.StdmoduletypeS=sigtypettypeoptyperettypesnapshotvalapply:t->op->retDeferred.t(* * This will return when the state machine is able to * accept operations again. *)valsnapshot:t->snapshotDeferred.tend
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.