Liking cljdoc? Tell your friends :D

bract.core.inducer

The inducer functions exposed by bract.core module.

The inducer functions exposed by `bract.core` module.
raw docstring

*inducer-log*clj

Inducer log holder - :execs is expected to be bound to an (atom []).

Inducer log holder - :execs is expected to be bound to an `(atom [])`.
sourceraw docstring

abortclj

(abort context)
(abort context message)

Abort the entire inducer chain.

Abort the entire inducer chain.
sourceraw docstring

add-shutdown-hookclj

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

apply-inducerclj

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

context-hookclj

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

discover-hostnameclj

(discover-hostname context)
(discover-hostname context
                   {:keys [config-key] :or {config-key "discovered.hostname"}})

Discover hostname and add to config if absent. Options:

KwargDescription
:config-keyconfiguration 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"`|
sourceraw docstring

discover-project-edn-versionclj

(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:

KwargDescription
:config-keyconfiguration key to update discovered version at, default: "discovered.app.version"
:project-ednresource 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)        |
sourceraw docstring

export-as-syspropsclj

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

induceclj

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

invoke-deinitclj

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

invoke-launchersclj

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

invoke-stopperclj

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

read-configclj

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

read-contextclj

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

run-config-inducersclj

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

run-context-inducersclj

(run-context-inducers context)
(run-context-inducers context lookup-key)

Run the inducers specified in the context.

Run the inducers specified in the context.
sourceraw docstring

set-default-exception-handlerclj

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

set-verbosityclj

(set-verbosity context)

Set Bract verbosity flag and return context.

Set Bract verbosity flag and return context.
sourceraw docstring

unexport-syspropsclj

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

with-inducer-logcljmacro

(with-inducer-log context & body)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close