(create {:keys [lock-key lock-id expiry-ms acquire-timeout-ms
acquire-resolution-ms]
:or {expiry-ms default-expiry-ms
acquire-timeout-ms default-acquire-timeout-ms
acquire-resolution-ms default-acquire-resolution-ms}})
(acquire this)
(acquire this opts)
Acquire the lock. Returns true if acquired, false otherwise.
Acquire the lock. Returns true if acquired, false otherwise.
(acquire-with-timeout this)
(acquire-with-timeout this opts)
Like acquire
but will wait for the lock to be available up to acquire-timeout-ms
milliseconds.
If the lock is not acquired within that time, returns false.
Like `acquire` but will wait for the lock to be available up to `acquire-timeout-ms` milliseconds. If the lock is not acquired within that time, returns false.
(get-id this)
Get ID of the lock holder. Returns the ID of the lock holder.
Get ID of the lock holder. Returns the ID of the lock holder.
(get-lock-holder-id this)
Get ID of the lock holder. Returns the ID of the lock holder.
Get ID of the lock holder. Returns the ID of the lock holder.
(is-lock-holder? this)
Check if this instance is the lock holder. Returns true if it is, false otherwise.
Check if this instance is the lock holder. Returns true if it is, false otherwise.
(lock-expiry-in-ms this)
Returns number of milliseconds until the lock expires. Nil if lock doesn't exist
Returns number of milliseconds until the lock expires. Nil if lock doesn't exist
(release this)
Release the lock. Returns true if released, false otherwise.
Release the lock. Returns true if released, false otherwise.
(renew this)
Renew the lock. Returns true if renewed, false otherwise.
Renew the lock. Returns true if renewed, false otherwise.
(try-acquire* conn {:keys [lock-key lock-id expiry-ms]})
Try acquiring a lock, doesn't use timeouts - so it either acquires the lock or fails immediately. Returns true if acquired, false otherwise.
Try acquiring a lock, doesn't use timeouts - so it either acquires the lock or fails immediately. Returns true if acquired, false otherwise.
(try-acquire-with-timeout* conn
{:keys [lock-key lock-id expiry-ms acquire-timeout-ms
acquire-resolution-ms]})
Try acquiring a lock, with a timeout options
Try acquiring a lock, with a timeout options
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close