Liking cljdoc? Tell your friends :D

roomkey.zref

A Zookeeper-based reference type

A Zookeeper-based reference type
raw docstring

*max-update-attempts*clj


add-versioned-watchclj

(add-versioned-watch z k f)

Adds a watch function to the zref z. The watch fn must be a fn of 4 args: the key, the zref, its old-state and its new-state. Whenever the zref's state might have been changed, any registered watches will have their functions called. Note that the zref's state may have changed again prior to the fn call, so use old/new-state rather than derefing the zref. Note also that watch fns may be called from multiple threads simultaneously. Keys must be unique per zref, and can be used to remove the watch with remove-watch, but are otherwise considered opaque by the watch mechanism.

Adds a watch function to the zref z.  The watch fn must be a fn of 4 args:
the key, the zref, its old-state and its new-state. Whenever the zref's
state might have been changed, any registered watches will have their
functions called.  Note that the zref's state may have changed again
prior to the fn call, so use old/new-state rather than derefing the zref.
Note also that watch fns may be called from multiple threads
simultaneously.  Keys must be unique per zref, and can be used to remove
the watch with `remove-watch`, but are otherwise considered opaque
by the watch mechanism.
raw docstring

compare-version-and-set!clj

(compare-version-and-set! z current-version newval)

Atomically sets the value of z to newval if and only if the current version of z is identical to current-version. Returns true if set happened, else false

Atomically sets the value of z to `newval` if and only if the current
version of `z` is identical to `current-version`. Returns true if set
happened, else false
raw docstring

createclj

(create root-znode path default & options)

data-xformclj


versioned-derefclj

(versioned-deref z)

Return the current state (value and version) of the zref z.

Return the current state (value and version) of the zref `z`.
raw docstring

VersionedReferencecljprotocol

compareVersionAndSetclj

(compareVersionAndSet this current-version new-value)

Set to new-value only when current-version is latest

Set to new-value only when current-version is latest

vAddWatchclj

(vAddWatch this k f)

Add versioned watcher that will be called with new value and version

Add versioned watcher that will be called with new value and version

vDerefclj

(vDeref this)

Return referenced value and version

Return referenced value and version

ZNodeWatchingcljprotocol

pathclj

(path this)

Return the path of the backing ZNode

Return the path of the backing ZNode

startclj

(start this)

Start online operations

Start online operations

update!clj

(update! this version value)

Update the znode backing this zref

Update the znode backing this zref

zrefcljdeprecated

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

× close