(defsystem+ id & components)
(defsystem+ id [dependency ...] & components)
Create a new system of components. Example:
(defsystem+ MySystem [^:global configuration, api-options]
:engine []
:monitor [:scheduler :api]
:api [:engine {:options :api-options}]
:scheduler [:engine])
On startup, the following injections will happen:
:configuration
into :engine
, :api
and :scheduler
(since it is
marked as :global
),:engine
into :api
and :scheduler
,:api-options
- aliased as :options
- into :api
,:scheduler
and :api
into :monitor
.It is possible to give default values for each component using the :default
metadata:
(defsystem+ MySystem [...]
:engine ^{:default (default-engine)} []
...)
Unless the key :engine
is present and non-nil on system startup, it'll
be filled with the result of (default-engine)
.
Create a new system of components. Example: (defsystem+ MySystem [^:global configuration, api-options] :engine [] :monitor [:scheduler :api] :api [:engine {:options :api-options}] :scheduler [:engine]) On startup, the following injections will happen: - `:configuration` into `:engine`, `:api` and `:scheduler` (since it is marked as `:global`), - `:engine` into `:api` and `:scheduler`, - `:api-options` - aliased as `:options` - into `:api`, - `:scheduler` and `:api` into `:monitor`. It is possible to give default values for each component using the `:default` metadata: (defsystem+ MySystem [...] :engine ^{:default (default-engine)} [] ...) Unless the key `:engine` is present and non-nil on system startup, it'll be filled with the result of `(default-engine)`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close