A lease row that replicas take turns holding, timed by the database clock
so replica clock skew cannot split it. A holder paused past lease-ms may
overlap the next one until it notices; callers whose work must not run twice
guard it separately.
A lease row that replicas take turns holding, timed by the database clock so replica clock skew cannot split it. A holder paused past `lease-ms` may overlap the next one until it notices; callers whose work must not run twice guard it separately.
(claim! {:keys [ds lease-name claim-sql]} owner lease-ms)Take the lease for owner, or renew it, for lease-ms. True when held.
owner is at most 36 characters: older tables were made with that width.
Take the lease for `owner`, or renew it, for `lease-ms`. True when held. `owner` is at most 36 characters: older tables were made with that width.
(create-lease ds table lease-name)The lease lease-name in table on ds. Call create-table! first.
The lease `lease-name` in `table` on `ds`. Call `create-table!` first.
(create-table! ds table lease-name)Create table and its row for lease-name if absent. Safe to call from
every replica at boot.
Create `table` and its row for `lease-name` if absent. Safe to call from every replica at boot.
(release! {:keys [ds lease-name release-sql]} owner)Hand the lease on, if owner holds it.
Hand the lease on, if `owner` holds it.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |