replikativ.stage
A stage allows to execute upstream operations of each CRDT and
communicates them downstream to a peer through
synchronous (blocking) operations.
cleanup-ops-and-new-values!
(cleanup-ops-and-new-values! stage upstream fetched-vals)
connect!
(connect! stage url & {:keys [retries], :or {retries Long/MAX_VALUE}})
Connect stage to a remote url of another peer,
e.g. ws://remote.peer.net:1234/replikativ/ws. Returns go block to
synchronize.
create-stage!
(create-stage! user peer)
Create a stage for user, given peer and a safe evaluation function
for the transaction functions. Returns go block to synchronize.
ensure-crdt
(ensure-crdt crdt-class stage [user crdt-id])
go-try-locked
macro
(go-try-locked stage & code)
remove-crdts!
(remove-crdts! stage crdts)
Remove crdts map from stage, e.g. {user #{crdt-id}}.
Returns go block to synchronize.
subscribe-crdts!
(subscribe-crdts! stage crdts)
Subscribe stage to crdts map, e.g. {user #{crdt-id}}.
This is not additive, but only these identities are
subscribed on the stage afterwards. Returns go block to synchronize.
sync!
(sync! stage-val [user crdt-id])
Synchronize (push) the results of an upstream CRDT command with
storage and other peers. Returns go block to synchronize.