(configure component config)
(configure component config merge-fn)
Recursively merge config map into component using merge-fns as necessary. Maps are recursively merged. Sets, vectors and lists are non-recursively concatenated.
This behavior can be overridden with merge-fns, which should match the structure of config and value. A merge function takes two arguments: the current value, and the configured value (respectively) and should return the final, resolved value.
Example:
user> (amalgam/configure {:a [1] :b {:c [2]}}
{:a [10] :b {:c [20] :d 30}}
{:b {:c amalgam/overwrite}})
{:a [1 10], :b {:c [20], :d 30}}
Recursively merge config map into component using merge-fns as necessary. Maps are recursively merged. Sets, vectors and lists are non-recursively concatenated. This behavior can be overridden with merge-fns, which should match the structure of config and value. A merge function takes two arguments: the current value, and the configured value (respectively) and should return the final, resolved value. Example: ```clojure user> (amalgam/configure {:a [1] :b {:c [2]}} {:a [10] :b {:c [20] :d 30}} {:b {:c amalgam/overwrite}}) {:a [1 10], :b {:c [20], :d 30}} ```
(overwrite _v c)
Resolve current and configuration values by always taking the configuration value.
Resolve current and configuration values by always taking the configuration value.
(run-system make-system read-config)
(run-system make-system read-config merge-fns)
Start a configured system and run it until the JVM exits.
make-system
— no argument function returning a new systemread-config
— no argument function returning the configuration map. The configuration map
should mirror the structure of the system.merge-fns
(optional) — map mirroring the structure of both the system and configuration
maps that contains merge functions to resolve a final value from the current value and
configured value.Start a configured system and run it until the JVM exits. - **`make-system`** — no argument function returning a new system - **`read-config`** — no argument function returning the configuration map. The configuration map should mirror the structure of the system. - **`merge-fns`** (optional) — map mirroring the structure of both the system and configuration maps that contains merge functions to resolve a final value from the current value and configured value. See [[configure]] [[start-system]]
(start-system make-system read-config)
(start-system make-system read-config merge-fns)
Construct, configure, then start a system.
make-system
— no argument function returning a new systemread-config
— no argument function returning the configuration map. The configuration map
should mirror the structure of the system.merge-fns
(optional) — map mirroring the structure of both the system and configuration
maps that contains merge functions to resolve a final value from the current value and
configured value.Example:
user> (amalgam/start-system #(component/system-map :component (map->Component {:foo :bar}))
(constantly {:component {:foo :baz}})
{:component {:foo amalgam/overwrite}})
{:component {:foo :baz}}
See configure
Construct, configure, then start a system. - **`make-system`** — no argument function returning a new system - **`read-config`** — no argument function returning the configuration map. The configuration map should mirror the structure of the system. - **`merge-fns`** (optional) — map mirroring the structure of both the system and configuration maps that contains merge functions to resolve a final value from the current value and configured value. Example: ```clojure user> (amalgam/start-system #(component/system-map :component (map->Component {:foo :bar})) (constantly {:component {:foo :baz}}) {:component {:foo amalgam/overwrite}}) {:component {:foo :baz}} ``` See [[configure]]
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close