Liking cljdoc? Tell your friends :D

hara.concurrent.procedure.registry


*default-registry*clj


add-instanceclj

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

adds something to the registry

(->> (add-instance (data/registry) "hello" :1 {:a 1}) (into {}) :store deref) => {"hello" {:1 {:a 1}}}

adds something to the registry

(->> (add-instance (data/registry) "hello" :1 {:a 1})
     (into {})
     :store
     deref)
=> {"hello" {:1 {:a 1}}}
raw docstring

get-instanceclj

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

lists all items in the registry

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

lists all items in the registry

(-> (data/registry)
    (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

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

kills the running instance in the registry

(-> (data/registry)
    (add-instance "hello" :1 {:thread (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

(-> (data/registry) (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

(-> (data/registry)
    (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

(-> (data/registry) (add-instance "hello" :1 {:a 1}) (remove-instance "hello" :1) (into {}) :store deref) => {}

removes something from the registry

 (-> (data/registry)
     (add-instance "hello" :1 {:a 1})
     (remove-instance "hello" :1)
     (into {})
     :store
     deref)
=> {}
raw docstring

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

× close