Liking cljdoc? Tell your friends :D

realm.core

This namespace provides the core logic for starting and stopping components with dependencies. Validation of components is expected to be done before calling the public api functions (starter and stopper).

Contract is (when using default options):

  • sys is nil or a map
  • cmps is a map of component id to component definition, where a component definition is a map with an optional :deps keyword or vector of component ids.
  • user-opts should be a map with a :invoke-start, :invoke-stop and circular-dep-handler keywords. See default-opts for the signature.
  • default-opts provides default implementations for these options, but they can be overridden by user-opts.
  • as per default-opts components are expected to have :start and :stop single arity functions, in any case the result of invoke-start is assigned to the component id in sys, and the result of invoke-stop is ignored
  • invoke-start function is expected to return a non-nil value

Components that have dependents that are 'running' (i.e. their id is a key in sys with a non-nil value) cannot be stopped, unless the :force-stop option is true.

Components that are already started (i.e. their id is a key in sys with a non-nil value) cannot be started again, and sys will be returned as is. Any dependencies of that component that are stopped will also not be started, since this will bring sys into an inconsistent state (the started component will not get these newly started dependencies).

This namespace provides the core logic for starting and stopping components
with dependencies. Validation of components is expected to be done before
calling the public api functions (starter and stopper).

Contract is (when using default options):

 - sys is nil or a map
 - cmps is a map of component id to component definition, where a component
   definition is a map with an optional :deps keyword or vector of component
   ids.
 - user-opts should be a map with a :invoke-start, :invoke-stop and
   circular-dep-handler keywords. See default-opts for the signature.
 - default-opts provides default implementations for these options, but they can be
   overridden by user-opts.
 - as per default-opts components are expected to have :start and :stop single arity
   functions, in any case the result of invoke-start is assigned to the component
   id in sys, and the result of invoke-stop is ignored
 - invoke-start function is expected to return a non-nil value

Components that have dependents that are 'running' (i.e. their id is a key in
sys with a non-nil value) cannot be stopped, unless the :force-stop option is
true.

Components that are already started (i.e. their id is a key in sys with a
non-nil value) cannot be started again, and sys will be returned as is. Any
dependencies of that component that are stopped will also not be started,
since this will bring sys into an inconsistent state (the started component
will not get these newly started dependencies). 
raw docstring

as-vectorclj

(as-vector deps)

If deps is a keyword, return it as a vector, otherwise return it as is.

If deps is a keyword, return it as a vector, otherwise return it as is.
sourceraw docstring

default-optsclj

source

starterclj

(starter sys cmps id user-opts)

Given a sys map and cmps start a cmp by id.

Given a sys map and cmps start a cmp by id.
sourceraw docstring

stopperclj

(stopper sys cmps id user-opts)

Given a sys map and cmps stops a cmp by id.

Given a sys map and cmps stops a cmp by id.
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