(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}}}
(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}
(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
(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}]
(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) => {}
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close