(alias-component component-id)
creates a component that just provides an instance defined elsewhere in the system
creates a component that just provides an instance defined elsewhere in the system
(assoc-many m assocs)
(assoc-many m prefix assocs)
(assoc-many {} {[:foo :bar] :bux}) => {:foo {:bar :bux}
(assoc-many {} {[:foo :bar] :bux}) => {:foo {:bar :bux}
(cache-component {:keys [:donut.system/start :donut.system/stop]
:as component-def}
&
[cache-key])
cache component instance so that it's preserved between start/stop. takes as
its argument a component def which must at least have a ::start
signal handler
that's a function. Useful for e.g. not restarting a threadpool for every test.
::stop signal won't fire unless instance is removed from
component-instance-cache
instances are cached by [group-name component-name cache-key]
cache component instance so that it's preserved between start/stop. takes as its argument a component def which must at least have a `::start` signal handler that's a function. Useful for e.g. not restarting a threadpool for every test. ::stop signal won't fire unless instance is removed from `component-instance-cache` instances are cached by [group-name component-name cache-key]
(component-dependencies system component-id)
Set of all references to other components
Set of all references to other components
(component-doc system component-id)
(component-id ref)
(component-ids system & [facet-key])
Components are grouped. This theoretically helps if publishing a component library. It also helps when creating multiple instances of the same collection of components because components are allowed to have local refs. See TODO for more details.
Components are grouped. This theoretically helps if publishing a component library. It also helps when creating multiple instances of the same collection of components because components are allowed to have local refs. See TODO for more details.
Component-like data shows up in ::defs
, ::resolved-defs
, and ::instances
. None
of these are the component per se, but they are the way the component
manifests in that context.
Component-like data shows up in `::defs`, `::resolved-defs`, and `::instances`. None of these are the component per se, but they are the way the component manifests in that context.
which graph sort order to follow to apply signal, and where to put result
which graph sort order to follow to apply signal, and where to put result
(dependency-pairs system)
Pairs of [A B], where A is component that depends on B
Pairs of [A B], where A is component that depends on B
(describe-component system component-id)
(describe-components system)
(describe-system system)
(flat-assoc-in m p v)
(flat-get-in m p)
Graphs are used to specify component dependency order and signal application order.
Graphs are used to specify component dependency order and signal application order.
(group-ref-exception _system
referencing-component-id
referenced-component-group-name)
(group-ref? ref)
(init-system maybe-system signal-name)
(instance system)
(instance system [component-group component-name :as component-id])
Get a specific component instance. With no arguments returns set of all component names.
Get a specific component instance. With no arguments returns set of all component names.
(local-ref k)
Check that at least one of the signals is present
Check that at least one of the signals is present
A way to name different system, e.g. :test, :dev, :prod, etc.
A way to name different system, e.g. :test, :dev, :prod, etc.
Topsorted and reverse-topsorted graphs are generated once when a system is initialized and assoc'c into the system. These graphs are used when applying signals.
Topsorted and reverse-topsorted graphs are generated once when a system is initialized and assoc'c into the system. These graphs are used when applying signals.
(ref k)
(ref-exception _system referencing-component-id referenced-component-id)
(registry-instance system registry-key)
Returns a component instance for a given key, rather than a given path. Relies on ::registry mapping registry keys to component paths.
For cases where libraries want to use component instances without having to rely on hard-coded paths.
Returns a component instance for a given key, rather than a given path. Relies on ::registry mapping registry keys to component paths. For cases where libraries want to use component instances without having to rely on hard-coded paths.
(registry-ref k)
(registry-ref->ref system registry-key)
A placeholder component used to communicate that a component needs to be provided.
A placeholder component used to communicate that a component needs to be provided.
(reset-component-instance-cache!)
(resolved {:keys [:donut.system/component-id :donut.system/resolved-defs]})
(resume system)
(select-components system component-keys)
You can scope down what component keys to use. In subsequent interactions with a system, use only those component keys.
You can scope down what component keys to use. In subsequent interactions with a system, use only those component keys.
(signal system signal-name)
The set of signals your system can respond to is configurable. To apply a signal, the system needs to know in what order components should be traversed.
The set of signals your system can respond to is configurable. To apply a signal, the system needs to know in what order components should be traversed.
(start config-name)
(start config-name component-def-overrides)
(start config-name component-def-overrides component-ids)
(stop system)
(stop-failed-system)
(stop-failed-system e)
Will attempt to stop a system that threw an exception when starting
Will attempt to stop a system that threw an exception when starting
(subsystem-component subsystem & [imports])
Decorates a subsystem so that it can respond to signals when embedded in a parent component.
Decorates a subsystem so that it can respond to signals when embedded in a parent component.
(suspend system)
(system sconf)
(system sconf component-def-overrides)
(system sconf component-def-overrides selected-components)
specify a system or a system named registered with config
, and optionally
provide overrides
specify a system or a system named registered with `config`, and optionally provide overrides
(system-fixture system)
To be used with use-fixtures
To be used with `use-fixtures`
(update-many m update-many-with-map)
Map of many paths to update, and their update fns
Map of many paths to update, and their update fns
(validate-instance-with-malli {:keys [:donut.system/instance ->validation
:donut.system/system]})
helper function for validating component instances with malli if a schema is present.
helper function for validating component instances with malli if a schema is present.
(with-*system* system & body)
Start a system and bind it to system. Stop system after body.
Start a system and bind it to *system*. Stop system after body.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close