(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.
(start system-config)Takes a system config to start. Returns a running system where the keys map to the started component. 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. 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 builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |