(deval body)
EXPERIMENTAL. Defers evaluation of lists. Useful for defining component start/stop/etc. functions.
EXPERIMENTAL. Defers evaluation of lists. Useful for defining component start/stop/etc. functions.
Executor which runs sync between calls.
Executor which runs sync between calls.
(select system-config component-ks)
Return system-config with an updated :components to only contain components
in component-ks
& their transitive dependencies.
Return system-config with an updated :components to only contain components in `component-ks` & their transitive dependencies.
(start system-config)
(start system-config component-ks)
Takes a system config to start. Returns a running system where the keys map
to the started component. If provided, only the components in component-ks
and their transitive dependencies will be started, otherwise all components.
Runs the :pre-start, :start and :post-start keys in that order.
:pre-start and :start may contains references, and will be executed without
an implicit target.
:post-start may also contain references, but will have the started component
as an implict target. This means that a symbol on it's own will work instead
of requiring a code form, in addition the anaphoric variable this
is
available to refer to the started component.
Takes a system config to start. Returns a running system where the keys map to the started component. If provided, only the components in `component-ks` and their transitive dependencies will be started, otherwise all components. Runs the :pre-start, :start and :post-start keys in that order. :pre-start and :start may contains references, and will be executed without an implicit target. :post-start may also contain references, but will have the started component as an implict target. This means that a symbol on it's own will work instead of requiring a code form, in addition the anaphoric variable `this` is available to refer to the started component.
(stop system-config running-system)
Takes a system config to stop.
Runs the :stop key, which may not contain references, and will be executed with the started component as an implict target. If no :stop is provided and the target is AutoClosable then .close will be called on it, otherwise nothing.
Takes a system config to stop. Runs the :stop key, which may not contain references, and will be executed with the started component as an implict target. If no :stop is provided and the target is AutoClosable then .close will be called on it, otherwise nothing.
(with-deps [dep-binding & args] & body)
Takes bindings and a body, like fn
. The first binding must be to deps, and
be a destructuring of the deps you want.
(with-deps [{:keys [foo bar]}]
(+ foo bar))
(with-deps [{foo :foo}]
(str foo))
Remaining bindings will be arguments to the generated function. For example, :stop will provide you with the running instance to stop.
(with-deps [{:keys [foo]} this]
(.close this foo))
Takes bindings and a body, like `fn`. The first binding must be to deps, and be a destructuring of the deps you want. ``` (with-deps [{:keys [foo bar]}] (+ foo bar)) ``` ``` (with-deps [{foo :foo}] (str foo)) ``` Remaining bindings will be arguments to the generated function. For example, :stop will provide you with the running instance to stop. ``` (with-deps [{:keys [foo]} this] (.close this foo)) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close