Liking cljdoc? Tell your friends :D
Clojure only.

hive-compose.promote.sync

Three-way merge of the persisted state {:active {id Active} :current id}.

Two addon instances can share one state file for a while: a hot remount mounts a new instance while a call still runs on the old one. Each instance keeps the state it last read or wrote (base). On every write it merges its own state (mine) with what the file holds now (theirs):

  • a key only one side changed takes that side's value, a removal included;
  • a key both sides changed to two maps merges them: claims key by key the same way, the rest from the side touched last, :last-touch the later;
  • a key one side removed while the other changed it stays, because losing a claim or a running section costs more than keeping an entry the reaper or the forget pass drops later.

Pure: no clock, no file.

Three-way merge of the persisted state {:active {id Active} :current id}.

Two addon instances can share one state file for a while: a hot remount
mounts a new instance while a call still runs on the old one. Each instance
keeps the state it last read or wrote (`base`). On every write it merges its
own state (`mine`) with what the file holds now (`theirs`):

  - a key only one side changed takes that side's value, a removal included;
  - a key both sides changed to two maps merges them: claims key by key the
    same way, the rest from the side touched last, :last-touch the later;
  - a key one side removed while the other changed it stays, because losing a
    claim or a running section costs more than keeping an entry the reaper
    or the forget pass drops later.

Pure: no clock, no file.
raw docstring

merge-stateclj

(merge-state base mine theirs)

The persisted state from base (last synced), mine (this instance) and theirs (the file now). Each is {:active {..} :current id-or-nil}.

The persisted state from `base` (last synced), `mine` (this instance) and
`theirs` (the file now). Each is {:active {..} :current id-or-nil}.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close