Liking cljdoc? Tell your friends :D

taoensso.carmine.locks

Alpha - subject to change. Distributed lock implementation for Carmine based on work by Ronen Narkis and Josiah Carlson. Redis 2.6+.

Redis keys:

  • carmine:lock:<lock-name> -> ttl str, lock owner's UUID.

Ref. http://goo.gl/5UalQ for implementation details.

Alpha - subject to change.
Distributed lock implementation for Carmine based on work by Ronen Narkis
and Josiah Carlson. Redis 2.6+.

Redis keys:
  * carmine:lock:<lock-name> -> ttl str, lock owner's UUID.

Ref. http://goo.gl/5UalQ for implementation details.
raw docstring

acquire-lockclj

(acquire-lock conn-opts lock-name timeout-ms wait-ms)

Attempts to acquire a distributed lock, returning an owner UUID iff successful.

Attempts to acquire a distributed lock, returning an owner UUID iff successful.
sourceraw docstring

have-lock?clj

(have-lock? conn-opts lock-name owner-uuid)
source

release-lockclj

(release-lock conn-opts lock-name owner-uuid)

Attempts to release a distributed lock, returning true iff successful.

Attempts to release a distributed lock, returning true iff successful.
sourceraw docstring

with-lockcljmacro

(with-lock conn-opts lock-name timeout-ms wait-ms & body)

Attempts to acquire a distributed lock, executing body and then releasing lock when successful. Returns {:result <body's result>} on successful release, or nil if the lock could not be acquired. If the lock is successfully acquired but expires before being released, throws an exception.

Attempts to acquire a distributed lock, executing body and then releasing
lock when successful. Returns {:result <body's result>} on successful release,
or nil if the lock could not be acquired. If the lock is successfully acquired
but expires before being released, throws an exception.
sourceraw docstring

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

× close