Liking cljdoc? Tell your friends :D

omega-red.lock


createclj

(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}})
source

get-lock-holder-id*clj

(get-lock-holder-id* conn {:keys [lock-key]})
source

lock-expiry-in-ms*clj

(lock-expiry-in-ms* conn {:keys [lock-key]})
source

lock-scriptclj

source

RedLockcljprotocol

acquireclj

(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-timeoutclj

(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-idclj

(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-idclj

(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?clj

(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-msclj

(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

releaseclj

(release this)

Release the lock. Returns true if released, false otherwise.

Release the lock. Returns true if released, false otherwise.

renewclj

(renew this)

Renew the lock. Returns true if renewed, false otherwise.

Renew the lock. Returns true if renewed, false otherwise.
source

release*clj

(release* conn {:keys [lock-key lock-id expiry-ms]})
source

release-scriptclj

source

renew*clj

(renew* conn {:keys [lock-key lock-id expiry-ms]})
source

renew-scriptclj

source

try-acquire*clj

(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.
sourceraw docstring

try-acquire-with-timeout*clj

(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
sourceraw docstring

with-lockcljmacro

(with-lock lock & body)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close