Configure module dependencies, manage module lifecycles, and set up the unified application log for inter-module communication.
Configure module dependencies, manage module lifecycles, and set up the unified application log for inter-module communication.
(then! this f)
Schedule state update f
for after the current chain of commands has
finished.
Updates internal state from return value. Return value can be a promise resolving to the new state.
Schedule state update `f` for after the current chain of commands has finished. Updates internal state from return value. Return value can be a promise resolving to the new state.
(create system-map)
Create an Application instance from module definitions in system-map
.
Each entry in system-map
defines a single module by mapping keywords to
the respective module-maps incorporating all configuration and state.
Create an Application instance from module definitions in `system-map`. Each entry in `system-map` defines a single module by mapping keywords to the respective module-maps incorporating all configuration and state.
(extend! this modules)
Extend system-map
to include modules defined in modules
.
New properties are added and existing properties are not changed.
Extend `system-map` to include modules defined in `modules`. New properties are added and existing properties are not changed.
(override! this modules)
Override system-map
to update modules defined in modules
.
New properties are added and existing properties are changed.
Override `system-map` to update modules defined in `modules`. New properties are added and existing properties are changed.
(init! app config)
(init! app config ks)
Load config
into app
. Returns a promise resolving to
the new system map after start.
Load `config` into `app`. Returns a promise resolving to the new system map after start.
(load! app modules)
Load modules defined in modules
into app
. Returns a promise resolving to
the new system map after start.
Updates app
and starts all provided modules immediately. Existing modules
are extended and only started when not already up.
Load modules defined in `modules` into `app`. Returns a promise resolving to the new system map after start. Updates `app` and starts all provided modules immediately. Existing modules are extended and only started when not already up.
(pause! app)
(pause! app ks)
Halt application by applying :pause
.
This is an alternate version of stop
presumably called during development,
e.g. before hot reloading code.
Halt application by applying `:pause`. This is an alternate version of `stop` presumably called during development, e.g. before hot reloading code.
(resume! app)
(resume! app ks)
Reactivate application by applying :resume
.
This is an alternate version of start
presumably called during development,
e.g. after hot reloading code.
Reactivate application by applying `:resume`. This is an alternate version of `start` presumably called during development, e.g. after hot reloading code.
(start! app)
(start! app ks)
Start modules defined in ks
and all their dependencies. Start all modules
defined by app
, when no ks
are given. Returns a promise resolving to the
new system map with updated module states.
Dependencies are guaranteed to be started first. :app-log
is injected, if
not already present, and automatically added to each module's :deps
.
Starting a module is idempotent (i.e., :start
is only called, when the
module is not already tagged as :started
). Module :state
is updated by
calling :start
on the current value and a map of dependency keys to values
returned by applying respective :export
on dependency :state
.
For additional context, the module key and the app
instance are also passed
to the update function.
When a circular dependency is detected, an error is thrown and starting is
aborted before any calls to :start
.
Start modules defined in `ks` and all their dependencies. Start all modules defined by `app`, when no `ks` are given. Returns a promise resolving to the new system map with updated module states. Dependencies are guaranteed to be started first. `:app-log` is injected, if not already present, and automatically added to each module's `:deps`. Starting a module is idempotent (i.e., `:start` is only called, when the module is not already tagged as `:started`). Module `:state` is updated by calling `:start` on the current value and a map of dependency keys to values returned by applying respective `:export` on dependency `:state`. For additional context, the module key and the `app` instance are also passed to the update function. When a circular dependency is detected, an error is thrown and starting is aborted before any calls to `:start`.
(stop! app)
(stop! app ks)
Stop modules defined in ks
and all their dependents. Stop all modules
defined by app
when no ks
are given. Returns a promise resolving to the
new system map with updated module states.
Dependent modules are guaranteed to be stopped first. :stop
is only called,
when the module is tagged as :started
. Nothing is called when a circular
dependency is detected.
Module :state
is updated by calling :stop
on the current value. :stop
defaults to setting the state to nil
.
Stop modules defined in `ks` and all their dependents. Stop all modules defined by `app` when no `ks` are given. Returns a promise resolving to the new system map with updated module states. Dependent modules are guaranteed to be stopped first. `:stop` is only called, when the module is tagged as `:started`. Nothing is called when a circular dependency is detected. Module `:state` is updated by calling `:stop` on the current value. `:stop` defaults to setting the state to `nil`.
(then this f)
Return promise resolving to application state after current chain of commands has finished.
Return promise resolving to application state after current chain of commands has finished.
(down! this txs ks)
Tear down modules ks
and their dependencies in reversed order by
applying interceptors txs
.
Tear down modules `ks` and their dependencies in reversed order by applying interceptors `txs`.
(tx! this txs ks)
Apply interceptors txs
to modules ks
.
Apply interceptors `txs` to modules `ks`.
(up! this txs ks)
Elevate modules ks
and their dependencies by applying interceptors
txs
.
Elevate modules `ks` and their dependencies by applying interceptors `txs`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close