The inducer functions exposed by bract.core module.
The inducer functions exposed by `bract.core` module.
Inducer log holder - :execs is expected to be bound to an (atom []).
Inducer log holder - :execs is expected to be bound to an `(atom [])`.
(abort context)(abort context message)Abort the entire inducer chain.
Abort the entire inducer chain.
(add-shutdown-hook context)(add-shutdown-hook context inducer)Given context with :bract.core/*shutdown-flag and :bract.core/shutdown-hooks keys related to app shutdown, and
config key "bract.core.drain.timeout", add an inducer as a shutdown hook. Specified inducer (invoke-deinit by
default) may be a function or a fully-qualified function name.
Given context with `:bract.core/*shutdown-flag` and `:bract.core/shutdown-hooks` keys related to app shutdown, and config key `"bract.core.drain.timeout"`, add an inducer as a shutdown hook. Specified inducer ([[invoke-deinit]] by default) may be a function or a fully-qualified function name.
(apply-inducer context inducer)(apply-inducer inducer-type context inducer)Given a context and inducer-spec, apply the inducer to the context (and args if any) returning updated context.
Given a context and inducer-spec, apply the inducer to the context (and args if any) returning updated context.
(context-hook context function)Given context with config, invoke the context-hook fn with context as argument.
Given context with config, invoke the context-hook fn with context as argument.
(discover-hostname context)(discover-hostname context
{:keys [config-key] :or {config-key "discovered.hostname"}})Discover hostname and add to config if absent. Options:
| Kwarg | Description |
|---|---|
:config-key | configuration key to update discovered hostname at, default: "discovered.hostname" |
Discover hostname and add to config if absent. Options: | Kwarg | Description | |-------------|-------------| |`:config-key`| configuration key to update discovered hostname at, default: `"discovered.hostname"`|
(discover-project-edn-version context)(discover-project-edn-version context
{:keys [config-key project-edn]
:or {config-key "discovered.app.version"
project-edn "project.edn"}})Discover application version from project.edn file containing :version key, and add to config if absent. Options:
| Kwarg | Description |
|---|---|
:config-key | configuration key to update discovered version at, default: "discovered.app.version" |
:project-edn | resource path to the project EDN file, default: "project.edn" (in classpath) |
Discover application version from project.edn file containing :version key, and add to config if absent. Options: | Kwarg | Description | |--------------|-------------| |`:config-key` | configuration key to update discovered version at, default: `"discovered.app.version"`| |`:project-edn`| resource path to the project EDN file, default: `"project.edn"` (in classpath) |
(export-as-sysprops context)Given context with config, read the value of config key "bract.core.exports" as a vector of string config keys
and export the key-value pairs for those config keys as system properties.
Given context with config, read the value of config key `"bract.core.exports"` as a vector of string config keys and export the key-value pairs for those config keys as system properties.
(induce context coll)(induce f context coll)Given a reducing function (fn [context inducer-spec]) -> context and a collection of inducer-specs, roll the seed
context through each inducer successively, returning updated context. The chain may be broken by an inducer returning
a reduced context, i.e. (reduced context).
Given a reducing function `(fn [context inducer-spec]) -> context` and a collection of inducer-specs, roll the seed context through each inducer successively, returning updated context. The chain may be broken by an inducer returning a reduced context, i.e. `(reduced context)`.
(invoke-deinit context)(invoke-deinit context ignore-errors?)Given context with :bract.core/deinit key and corresponding collection of (fn []) de-init functions for the app,
invoke them in a sequence. Return context with empty deinit vector.
Given context with `:bract.core/deinit` key and corresponding collection of `(fn [])` de-init functions for the app, invoke them in a sequence. Return context with empty deinit vector.
(invoke-launchers context)(invoke-launchers context launchers)Given context with key :bract.core/launchers read its value as a vector of launcher fns and invoke them like
inducers (fn [context]) -> context when the context key :bract.core/launch? has the value true.
Given context with key `:bract.core/launchers` read its value as a vector of launcher fns and invoke them like inducers `(fn [context]) -> context` when the context key `:bract.core/launch?` has the value `true`.
(invoke-stopper context)Given context with :bract.core/stopper key and corresponding (fn []) stopper function for the app, invoke it.
Given context with `:bract.core/stopper` key and corresponding `(fn [])` stopper function for the app, invoke it.
(read-config context)Use config filenames in the context under key :bract.core/config-files to read and resolve config, and populate
the context with it under the key :bract.core/config.
Use config filenames in the context under key `:bract.core/config-files` to read and resolve config, and populate the context with it under the key `:bract.core/config`.
(read-context context)Use context filename (when specified) in the context under key :bract.core/context-file to read from and merge
into the context.
Use context filename (when specified) in the context under key `:bract.core/context-file` to read from and merge into the context.
(run-config-inducers context)(run-config-inducers context lookup-key)Run the inducers specified in the application config.
Run the inducers specified in the application config.
(run-context-inducers context)(run-context-inducers context lookup-key)Run the inducers specified in the context.
Run the inducers specified in the context.
(set-default-exception-handler context)(set-default-exception-handler context exception-handler)Set specified function (STDERR printer by default) as the default uncaught-exception handler for all JVM threads.
Set specified function (STDERR printer by default) as the default uncaught-exception handler for all JVM threads.
(set-verbosity context)Set Bract verbosity flag and return context.
Set Bract verbosity flag and return context.
(unexport-sysprops context)Given context with config, read the value of config key "bract.core.exports" as a vector of string config keys
and remove them from system properties.
Given context with config, read the value of config key `"bract.core.exports"` as a vector of string config keys and remove them from system properties.
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 |