Liking cljdoc? Tell your friends :D

ring-nexus.core


add-respond-effectclj

(add-respond-effect nexus-template respond)

Pure function to add the respond callback to a prepared nexus template.

Pure function to add the respond callback to a prepared nexus template.
sourceraw docstring

add-response-actionsclj

(add-response-actions nexus)

Pure function to add HTTP response actions to a nexus configuration.

Pure function to add HTTP response actions to a nexus configuration.
sourceraw docstring

has-fail-fast-strategy?clj

(has-fail-fast-strategy? nexus)
source

maybe-add-fail-fastclj

(maybe-add-fail-fast nexus)
source

prepare-nexus-templateclj

(prepare-nexus-template nexus
                        {:ring-nexus/keys [fail-fast? add-response-actions?]
                         :or {fail-fast? true add-response-actions? true}})

Prepares the nexus template with all static configuration, leaving only the respond callback to be injected per request.

Prepares the nexus template with all static configuration, leaving only
the respond callback to be injected per request.
sourceraw docstring

wrap-nexusclj

(wrap-nexus handler
            {:keys [nexus/system->state] :as nexus}
            system
            &
            [{:ring-nexus/keys [state-k on-error]
              :or {state-k :nexus/state
                   on-error (fn* [p1__1747#] (throw p1__1747#))}
              :as opts}])

Given a nexus config map and a live system, wrap nexus action dispatch to provide FCIS (Functional Core Imperative Shell) support.

Parameters:

  • handler - The handler on which to wrap

  • nexus - The nexus config map. See https://github.com/cjohansen/nexus for more info on what the nexus map requires

  • system - The live system that will be passed to nexus. Can be an atom, a DB connection, a map containing multiple atoms, datomic connections or any link to a live system. N.B. nexus requires a :nexus/system->state functon that transforms the system into a immutable state snapshot. wrap-nexus will use nexus/system->state to add a snapshot of the state to the ring request

  • opts - Last parameter is an optional config map:

    • :ring-nexus/state-k - the key on which to put the state snapshot

    • :ring-nexus/fail-fast? - If nexus should fail fast if one of the dispatch actions failed. Default is true.

    • :ring-nexus/on-error - callback used with error from actions/effects. Defaults to throw

    • :ring-nexus/add-response-actions? - Whether the middleware should add convenience response actions or not. See add-response-actions for the actions. Defaults to true.

Given a nexus config map and a live system, wrap nexus action dispatch to
provide FCIS (Functional Core Imperative Shell) support.

Parameters:

- handler - The handler on which to wrap

- nexus - The nexus config map. See https://github.com/cjohansen/nexus for more
          info on what the nexus map requires

- system - The live system that will be passed to nexus. Can be an atom, a DB
           connection, a map containing multiple atoms, datomic connections or any link
           to a live system. N.B. nexus requires a :nexus/system->state functon that
           transforms the system into a immutable state snapshot. `wrap-nexus` will use
           `nexus/system->state` to add a snapshot of the state to the ring request

- opts  - Last parameter is an optional config map:

  - `:ring-nexus/state-k` - the key on which to put the state snapshot

  - `:ring-nexus/fail-fast?` - If nexus should fail fast if one of the dispatch actions
                               failed. Default is true.

  - `:ring-nexus/on-error` - callback used with error from actions/effects. Defaults to throw

  - `:ring-nexus/add-response-actions?` - Whether the middleware should add convenience response
                                          actions or not. See `add-response-actions` for the actions.
                                          Defaults to true.
sourceraw docstring

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

× close