Liking cljdoc? Tell your friends :D

hara.function.procedure.registry


+default-registryclj

(+default-registry ??)
?? invalid arglists:
()

default registry for running procedure instances

default registry for running procedure instances
raw docstring

add-instanceclj

(add-instance name id instance)
(add-instance registry name id instance)

adds something to the registry

@(add-instance (cache/cache {}) "hello" :1 {:a 1}) => {"hello" {:1 {:a 1}}}

adds something to the registry

@(add-instance (cache/cache {}) "hello" :1 {:a 1})
=> {"hello" {:1 {:a 1}}}
raw docstring

get-instanceclj

(get-instance name id)
(get-instance registry name id)

lists all items in the registry

(-> (cache/cache {}) (add-instance "hello" :1 {:a 1}) (add-instance "hello" :2 {:b 1}) (get-instance "hello" :2)) => {:b 1}

lists all items in the registry

(-> (cache/cache {})
    (add-instance  "hello" :1 {:a 1})
    (add-instance "hello" :2 {:b 1})
    (get-instance "hello" :2))
=> {:b 1}
raw docstring

killclj

(kill name id)
(kill registry name id)

kills the running instance in the registry

(-> (cache/cache {}) (add-instance "hello" :1 {:thread (volatile! (future (Thread/sleep 100000)))}) (kill "hello" :1)) => true

kills the running instance in the registry

(-> (cache/cache {})
    (add-instance "hello" :1 {:thread (volatile! (future (Thread/sleep 100000)))})
    (kill "hello" :1))
=> true
raw docstring

list-instancesclj

(list-instances name)
(list-instances registry name)

lists all items in the registry

(-> (cache/cache {}) (add-instance "hello" :1 {:a 1}) (add-instance "hello" :2 {:b 1}) (list-instances "hello")) => [{:a 1} {:b 1}]

lists all items in the registry

(-> (cache/cache {})
    (add-instance  "hello" :1 {:a 1})
    (add-instance  "hello" :2 {:b 1})
    (list-instances "hello"))
=> [{:a 1} {:b 1}]
raw docstring

remove-instanceclj

(remove-instance name id)
(remove-instance registry name id)

removes something from the registry

(-> (cache/cache {}) (add-instance "hello" :1 {:a 1}) (remove-instance "hello" :1) deref) => {}

removes something from the registry

(-> (cache/cache {})
    (add-instance "hello" :1 {:a 1})
    (remove-instance "hello" :1)
    deref)
=> {}
raw docstring

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

× close