Liking cljdoc? Tell your friends :D

a-frame.interceptor-chain


after-enter-update-contextclj/s

(after-enter-update-context {queue :a-frame.interceptor-chain/queue
                             stack :a-frame.interceptor-chain/stack
                             _history :a-frame.interceptor-chain/history
                             :as context}
                            _interceptor-fn-key
                            interceptor-spec
                            history-entry)

update a context after the enter fn has been processed

update a context after the enter fn has been processed
sourceraw docstring

after-leave-update-contextclj/s

(after-leave-update-context {stack :a-frame.interceptor-chain/stack
                             _history :a-frame.interceptor-chain/history
                             _error :a-frame.interceptor-chain/error
                             :as context}
                            interceptor-fn-key
                            has-thunk?
                            _interceptor-spec
                            history-entry)

update a context after a leave fn has been processed

update a context after a leave fn has been processed
sourceraw docstring

assoc-opaque-keysclj/s

(assoc-opaque-keys ctx app-ctx a-frame-router)

add the opaque keys to the interceptor context

they are removed from reported contexts by sanitise-context

add the opaque keys to the interceptor context

they are removed from reported contexts by `sanitise-context`
sourceraw docstring

clear-errorclj/s

(clear-error context)

Removes any associated ::error from context

Removes any associated `::error` from `context`
sourceraw docstring

context-keysclj/s

The Interceptor specific keys that are added to contexts

The Interceptor specific keys that are added to contexts
sourceraw docstring

dissoc-context-keysclj/s

(dissoc-context-keys context)

Removes all interceptor related keys from context

Removes all interceptor related keys from `context`
sourceraw docstring

enqueueclj/s

(enqueue context interceptors)

Adds interceptors to the end of the interceptor queue within context

Adds `interceptors` to the end of the interceptor queue within `context`
sourceraw docstring

enter-allclj/s

(enter-all context)

Process the :queue of context, calling each :enter fn in turn.

If an error is raised it is captured, stored in the contexts :error key, and the queue is cleared (to prevent further processing.)

Process the `:queue` of `context`, calling each `:enter` `fn` in turn.

If an error is raised it is captured, stored in the `context`s `:error` key,
and the queue is cleared (to prevent further processing.)
sourceraw docstring

enter-nextclj/s

(enter-next {queue :a-frame.interceptor-chain/queue
             _stack :a-frame.interceptor-chain/stack
             _history :a-frame.interceptor-chain/history
             :as context})

Executes the next ::enter interceptor queued within context, returning a promise that will resolve to the next pr-loop-context action to take

TODO errors in [[resolve-data]] are not handled properly

Executes the next `::enter` interceptor queued within `context`, returning a
promise that will resolve to the next [[pr-loop-context]] action to take

TODO errors in [[resolve-data]] are not handled properly
sourceraw docstring

executeclj/s

(execute app-ctx a-frame-router interceptor-chain initial-context)

Returns a Promise encapsulating the execution of the given [[InterceptorContext]].

Runs all :enter interceptor fns (in FIFO order) and then all :leave fns (in LIFO order) returning the end result context map.

If an error occurs during execution :enter processing is terminated and the :error handlers of all executed interceptors are called (in LIFO order), with the original error wrapped in an ex-info with ex-data containing the at the point of failure in the ::resume key - this can be used to resume processing from the failure point

If the resulting context still contains an error after this processing it will be re-thrown when the execution promise is realised.

Returns a Promise encapsulating the execution of the given [[InterceptorContext]].

Runs all `:enter` interceptor fns (in FIFO order) and then all `:leave` fns
(in LIFO order) returning the end result `context` map.

If an error occurs during execution `:enter` processing is terminated and the
`:error` handlers of all executed interceptors are called (in LIFO order),
with the original error wrapped in an ex-info with ex-data containing the
at the point of failure in the ::resume key - this can be used to resume processing
from the failure point

If the resulting `context` _still_ contains an error after this processing it
will be re-thrown when the execution promise is realised. 
sourceraw docstring

execute*clj/s

(execute* context)

execute a context

execute a context
sourceraw docstring

final-error-handlerclj/s

(final-error-handler {err :a-frame.interceptor-chain/error :as ctx})

if there is still an error after processing, throw it

if there is still an error after processing, throw it
sourceraw docstring

initiateclj/s

(initiate app-ctx a-frame-router interceptor-chain initial-context)

Given a sequence of [[InterceptorSpec]]s and a map of initial-context values, returns a new [[InterceptorContext]] ready to execute

Given a sequence of [[InterceptorSpec]]s and a map of `initial-context` values,
returns a new [[InterceptorContext]] ready to [[execute]]
sourceraw docstring

initiate*clj/s

(initiate* interceptor-chain)
(initiate* initial-context interceptor-chain)
source

interceptor-fn-history-thunkclj/s

(interceptor-fn-history-thunk interceptor-fn-key
                              interceptor-spec
                              _context
                              error)

returns a [<history-entry> <interceptor-fn-thunk>]

<history-entry> :- [<interceptor-spec> <interceptor-fn-key> <operation> :- ::execute | ::noop <data> <outcome> :- ::success | ::error]

the <data> and <outcome> fields in the <history-entry> tuple will be added later. the <interceptor-fn-thunk> returns [<data> <next-context>] when it completes normally

returns a [<history-entry> <interceptor-fn-thunk>]

<history-entry> :-
  [<interceptor-spec>
   <interceptor-fn-key>
   <operation> :- ::execute | ::noop
   <data>
   <outcome> :- ::success | ::error]

the <data> and <outcome> fields in the <history-entry> tuple
will be added later. the <interceptor-fn-thunk> returns
[<data> <next-context>] when it completes normally
sourceraw docstring

leave-allclj/s

(leave-all context)

Process the ::stack of context, calling, in LIFO order.

If an ::error is present in the context then the ::error handling fn of the interceptors will be called otherwise the :leave fns will be called.

Any thrown errors will replace the current ::error with stack unwinding continuing from that point forwards.

Process the `::stack` of `context`, calling, in LIFO order.

If an `::error` is present in the `context` then the `::error` handling `fn`
of the interceptors will be called otherwise the `:leave` `fn`s will be
called.

Any thrown errors will replace the current `::error` with stack unwinding
continuing from that point forwards.
sourceraw docstring

leave-nextclj/s

(leave-next {stack :a-frame.interceptor-chain/stack
             _history :a-frame.interceptor-chain/history
             error :a-frame.interceptor-chain/error
             :as context})

Executes the next ::leave or ::error interceptor on the stack within context, returning a promise that will resolve to the next pr-loop-context action to take

Executes the next `::leave` or `::error` interceptor on the stack within
`context`, returning a promise that will resolve to the next
[[pr-loop-context]] action to take
sourceraw docstring

maybe-execute-interceptor-fnclj/s

(maybe-execute-interceptor-fn interceptor-fn-key interceptor-spec context error)

call an interceptor fn on an interceptor

call an interceptor fn on an interceptor
sourceraw docstring

maybe-execute-interceptor-fn-thunkclj/s

(maybe-execute-interceptor-fn-thunk thunk context)
source

normalize-interceptor-specclj/s

(normalize-interceptor-spec interceptor-spec)

turns keyword interceptor-specs into maps {::key <interceptor-key>}

turns keyword interceptor-specs into maps
{::key <interceptor-key>}
sourceraw docstring

opaque-context-keysclj/s

keys which contain opaque data

keys which contain opaque data
sourceraw docstring

pr-loop-contextclj/s

(pr-loop-context context step-fn)
source

pr-loop-context*clj/s

(pr-loop-context* context step-fn)

Helper fn to repeat execution of step-fn against context inside a promise loop.

step-fn should return a tuple of either [::break <value>] or [::recur <new context>]. The former will terminate the loop and return <value>, the later will pass <new context> to the next loop iteration.

(Note: this mainly exists to abstract away and minimise the platform specific aspects of handling promise loops.)

Helper fn to repeat execution of `step-fn` against `context` inside a promise
loop.

`step-fn` should return a tuple of either `[::break <value>]` or `[::recur
<new context>]`. The former will terminate the loop and return `<value>`, the
later will pass `<new context>` to the next loop iteration.

(Note: this mainly exists to abstract away and minimise the platform specific
aspects of handling promise loops.)
sourceraw docstring

record-interceptor-errorclj/s

(record-interceptor-error resume-context next-context e)

wrap an exception and record the error

wrap an exception and record the error
sourceraw docstring

register-interceptorclj/s

(register-interceptor interceptor-key interceptor)
source

resolve-interceptorclj/s

(resolve-interceptor interceptor-key)
source

resumeclj/s

(resume app-ctx a-frame-router err-or-resume-context)

resume a failed interceptor chain, from either a thrown exception or a logged resume-context

resume a failed interceptor chain, from either
a thrown exception or a logged resume-context
sourceraw docstring

rethrowclj/s

(rethrow e)

wrap an error in a marker exception for rethrowing rather than wrapping - allows an ::error fn to rethrow an error without confusing resume

wrap an error in a marker exception for rethrowing rather
than wrapping - allows an ::error fn to rethrow an error
without confusing resume
sourceraw docstring

rethrow?clj/s

(rethrow? o)

returns an error to rethrow or nil

returns an error to rethrow or nil
sourceraw docstring

sanitise-contextclj/s

(sanitise-context context)

remove impure / opaque data from a context

remove impure / opaque data from a context
sourceraw docstring

terminateclj/s

(terminate context)

Removes all queued interceptors from context

Removes all queued interceptors from `context`
sourceraw docstring

unwrap-original-errorclj/s

(unwrap-original-error e)

unwrap layers of error wrapping (in case of nested :dispatch) to get at the causal exception

unwrap layers of error wrapping (in case of nested :dispatch)
to get at the causal exception
sourceraw docstring

unwrap-resume-context-original-errorclj/s

(unwrap-resume-context-original-error e)

unwrap layers of error wrapping (in case of nested :dispatch) to get at the resume context and the causal exception

returns : [<resume-context> <original-error>]

unwrap layers of error wrapping (in case of nested :dispatch)
to get at the resume context and the causal exception

returns : [<resume-context> <original-error>]
sourceraw docstring

wrap-interceptor-errorclj/s

(wrap-interceptor-error resume-context e)
source

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

× close