replikativ.p2p.hooks
Allows pull hooks to automatically update publications by pulling/merging
to more CRDTs synchronously to the update propagation.
default-integrity-fn
(default-integrity-fn S store commit-ids)
hook
(hook hooks [S peer [in out]])
Configure automatic pulling (or merging) from CRDTs during a publication in atomic synchronisation with the original publication. This happens through a hooks atom containing a map, e.g. {[user-to-pull crdt-to-pull] [[user-to-pull-into crdt-to-pull-into] integrity-fn merge-order-fn] ...} for each pull hook.
user-to-pull can be the wildcard :* to pull from all users of the crdtsitory. This allows to have a central server crdtsitory/app state. You should shield this through authentication first. integrity-fn is given a set of new commit-ids to determine whether pulling is safe. merge-order-fn can reorder the commits for merging in case of conflicts.
hook-dispatch
(hook-dispatch {:keys [type]})
match-pubs
(match-pubs S cold-store mem-store atomic-pull-store [user crdt-id] {:keys [downstream], :as pub} hooks)
pull
(pull S hooks cold-store mem-store pub-ch new-in)