Liking cljdoc? Tell your friends :D

lambdaisland.makina.app

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.
raw docstring

componentclj

(component !app id)

Retrieve component value

Retrieve component value
sourceraw docstring

createclj

(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 components
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 components
sourceraw docstring

create*clj

(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.
sourceraw docstring

errorclj

(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.
sourceraw docstring

error*clj

(error* app)

Functional version of error

Functional version of [[error]]
sourceraw docstring

load!clj

(load! app)
source

load*clj

(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.
sourceraw docstring

load-handlersclj

(load-handlers system ns-prefix extra-handlers)
source

prep-refreshclj

(prep-refresh app-var-sym)
source

(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.
sourceraw docstring

refreshclj

(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)
sourceraw docstring

refresh-allclj

(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)
sourceraw docstring

restart!clj

(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.
sourceraw docstring

start!clj

(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.
sourceraw docstring

start*clj

(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.
sourceraw docstring

started-keysclj

(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
sourceraw docstring

stateclj

(state !app)
(state !app id)

System or component state

System or component state
sourceraw docstring

stop!clj

(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
sourceraw docstring

stop*clj

(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.
sourceraw docstring

valueclj

(value !app)

System value, a map of all component values

System value, a map of all component values
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close