Convenience layer with specific policy conventions
Rather than working on 'system' values (map with component values), it works on 'app' values, which contain a system value (:makina/system), as well as additional bookkeeping (:makina/state, :makina/config, etc).
This 'app value' is in turn wrapped in an atom, so we have an persistent identity to operate on.
Convenience layer with specific policy conventions Rather than working on 'system' values (map with component values), it works on 'app' values, which contain a system value (:makina/system), as well as additional bookkeeping (:makina/state, :makina/config, etc). This 'app value' is in turn wrapped in an atom, so we have an persistent identity to operate on.
(component !app id)Retrieve component value
Retrieve component value
(create {:keys [prefix ns-prefix config data-readers handlers] :as opts})Create a new Makina app
This is an atom containing a Makina system value, in the :not-loaded state.
The system configuration is loaded from <prefix>/system.edn on the
classpath, e.g. the resources folder.
:prefix - classpath prefix to find system.edn:config - override where the config is loaded from, map, function, or classpath location of an EDN file:ns-prefix - when auto-loading handlers, prefix each component name before loading:data-readers - like [[clojure.core/data-readers]], used while loading system.edn:handlers - explicit handlers, overrides the auto-load/auto-resolve functionality for specific componentsCreate a new Makina app This is an atom containing a Makina system value, in the `:not-loaded` state. The system configuration is loaded from `<prefix>/system.edn` on the classpath, e.g. the `resources` folder. - `:prefix` - classpath prefix to find `system.edn` - `:config` - override where the config is loaded from, map, function, or classpath location of an EDN file - `:ns-prefix` - when auto-loading handlers, prefix each component name before loading - `:data-readers` - like [[clojure.core/*data-readers*]], used while loading `system.edn` - `:handlers` - explicit handlers, overrides the auto-load/auto-resolve functionality for specific components
(create* {:keys [prefix ns-prefix config data-readers handlers profile]})Functional version of [[create!]], returns the system value, rather than the application atom.
Functional version of [[create!]], returns the system value, rather than the application atom.
(error !app)If a component is in the error state, return the Error.
Generally there is never more than one, since system startup stops when an error is encountered.
If a component is in the error state, return the Error. Generally there is never more than one, since system startup stops when an error is encountered.
(error* app)Functional version of error
Functional version of [[error]]
(load* {:makina/keys [config data-readers extra-handlers profile] :as app})Functional version of load!, takes the system value, rather than the
application atom.
Functional version of [[load!]], takes the system value, rather than the application atom.
(print-table !app)Show a table with the components in the system with their state, in the order they were started.
Show a table with the components in the system with their state, in the order they were started.
(refresh app-var-sym)Stop the app, call [[clojure.tools.namespace.repl/refresh]], then restart
Reloads any namespaces that have changed since the last call to refresh.
This gives you a fresh state. tools.namespace needs to be added manually as
a dependency, Makina does not automatically pull it in.
app-var-sym - a fully qualified symbol, a var with this name must exist,
and contain a Makina app (atom)Stop the app, call [[clojure.tools.namespace.repl/refresh]], then restart Reloads any namespaces that have changed since the last call to `refresh`. This gives you a fresh state. `tools.namespace` needs to be added manually as a dependency, Makina does not automatically pull it in. - `app-var-sym` - a fully qualified symbol, a var with this name must exist, and contain a Makina app (atom)
(refresh-all app-var-sym)Stop the app, call [[clojure.tools.namespace.repl/refresh-all]], then restart
Reloads all namespaces, this may include namespaces that were not loaded before. Use [[clojure.tools.namespace.repl/set-refresh-dirs]] to limit the source directories that get scanned for namespaces.
tools.namespace needs to be added manually as a dependency, Makina does not
automatically pull it in.
app-var-sym - a fully qualified symbol, a var with this name must exist,
and contain a Makina app (atom)Stop the app, call [[clojure.tools.namespace.repl/refresh-all]], then restart Reloads all namespaces, this may include namespaces that were not loaded before. Use [[clojure.tools.namespace.repl/set-refresh-dirs]] to limit the source directories that get scanned for namespaces. `tools.namespace` needs to be added manually as a dependency, Makina does not automatically pull it in. - `app-var-sym` - a fully qualified symbol, a var with this name must exist, and contain a Makina app (atom)
(restart! !app)(restart! !app ks)Restart either a specific set of keys, or all keys/components that are
currently in the :started state.
Restart either a specific set of keys, or all keys/components that are currently in the `:started` state.
(start! !app)(start! !app ks)Start the application
Move the app to the :started state, if it's not started yet. If the current
state is :not-loaded, first attempt to auto-load and resolve any missing
handlers. If the app is partially started (e.g. in an :error state), will
attempt to start any components that are stopped or have errored.
Start the application Move the app to the `:started` state, if it's not started yet. If the current state is `:not-loaded`, first attempt to auto-load and resolve any missing handlers. If the app is partially started (e.g. in an `:error` state), will attempt to start any components that are stopped or have errored.
(start* app)(start* {:makina/keys [state] :as app} ks)Functional version of start!, takes the system value, rather than the
application atom.
Functional version of [[start!]], takes the system value, rather than the application atom.
(started-keys app)Sequence of keys of components that are in the :started state
Sequence of keys of components that are in the `:started` state
(state !app)(state !app id)System or component state
System or component state
(stop! !app)(stop! !app ks)Stop the application
Move to the :stopped state, stopping any previously started components
Stop the application Move to the `:stopped` state, stopping any previously started components
(stop* sys)(stop* {:makina/keys [handlers system] :as app} ks)Functional version of stop!, takes the system value, rather than the
application atom.
Functional version of [[stop!]], takes the system value, rather than the application atom.
(value !app)System value, a map of all component values
System value, a map of all component values
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 |