[semidet]paxos_set(+Key,
+Value)
[semidet]paxos_set(+Key,
+Value, +Options)negotiates to have Key-Value recorded in the
ledger for each of the quorum's members. This predicate succeeds if the
quorum unanimously accepts the proposed term. If no such entry exists in
the Paxon's ledger, then one is silently created. paxos_set/1
will retry the transaction several times (default: 20) before failing.
Failure is rare and is usually the result of a collision of two or more
writers writing to the same term at precisely the same time. On failure,
it may be useful to wait some random period of time, and then retry the
transaction. By specifying a retry count of zero, paxos_set/2
will succeed iff the first ballot succeeds.
On success, paxos_set/1 will
also broadcast the term
paxos_changed(Key,Value)
, to the quorum.
Options processed:
- retry(Retries)
- is a non-negative integer specifying the number of retries that will be
performed before a set is abandoned. Defaults to the
setting
max_sets
(20).
- timeout(+Seconds)
- Max time to wait for the forum to reply. Defaults to the
setting
response_timeout
(0.020, 20ms).
Term | is a compound that may have unbound
variables. |
- To be done
- If the Value is already current, should we simply do nothing?