Liking cljdoc? Tell your friends :D

exoscale.interceptor


discardclj/s

(discard f)

Run function for side-effects only and return context

Run function for side-effects only and return context
raw docstring

enqueueclj/s

(enqueue ctx interceptors)

Adds interceptors to current context

Adds interceptors to current context
raw docstring

errorclj/s

(error ctx error)

Adds error to context, potentially triggering :error stage on current/next interceptor

Adds error to context, potentially triggering :error stage on
current/next interceptor
raw docstring

executeclj/s

(execute ctx)
(execute ctx interceptors)

Executes a queue of Interceptors attached to the context. Context must be a map.

An Interceptor is a map or map-like object with the keys :enter, :leave, and :error. The value of each key is a function; missing keys or nil values are ignored. When executing a context, first all the :enter functions are invoked in order. As this happens, the Interceptors are pushed on to a stack.

When execution reaches the end of the queue, it begins popping Interceptors off the stack and calling their :leave functions. Therefore :leave functions are called in the opposite order from :enter functions.

Both the :enter and :leave functions are called on a single argument, the context map, and return an updated context.

If any Interceptor function throws an exception, execution stops and begins popping Interceptors off the stack and calling their :error functions. The :error function takes a single argument: the context which would contain an :error key with the error triggering the call. If you leave the :error key in the context the other :error handlers will be triggered from the stack, if you remove it it will resume triggering :leave functions, you can also call (resume ctx) to remove the error and resume execution.

If the :error reaches the end of the stack without being handled, execute will throw it.

Executes a queue of Interceptors attached to the context. Context
must be a map.

An Interceptor is a map or map-like object with the keys :enter,
:leave, and :error. The value of each key is a function; missing
keys or nil values are ignored. When executing a context, first all
the :enter functions are invoked in order. As this happens, the
Interceptors are pushed on to a stack.

When execution reaches the end of the queue, it begins popping
Interceptors off the stack and calling their :leave functions.
Therefore :leave functions are called in the opposite order from
:enter functions.

Both the :enter and :leave functions are called on a single
argument, the context map, and return an updated context.

If any Interceptor function throws an exception, execution stops and
begins popping Interceptors off the stack and calling their :error
functions. The :error function takes a single argument: the context
which would contain an :error key with the error triggering the
call.  If you leave the :error key in the context the other :error
handlers will be triggered from the stack, if you remove it it will
resume triggering :leave functions, you can also call (resume ctx) to
remove the error and resume execution.

If the :error reaches the end of the stack without being handled,
execute will throw it.
raw docstring

haltclj/s

(halt ctx)

Removes all remaining interceptors from context's execution queue and stack. This effectively short-circuits execution of Interceptors' :enter/:leave and returns the context

Removes all remaining interceptors from context's execution queue and stack.
This effectively short-circuits execution of
Interceptors' :enter/:leave and returns the context
raw docstring

inclj/s

(in f path)

Modifies interceptor function to take in specified path

Modifies interceptor function to *take in* specified path
raw docstring

lensclj/s

(lens f path)

Modifies interceptor function to take from path and return to path

Modifies interceptor function to take from path and return to path
raw docstring

outclj/s

(out f path)

Modifies interceptor function return at specified path

Modifies interceptor function *return at* specified path
raw docstring

terminateclj/s

(terminate ctx)

Removes all remaining interceptors from context's execution queue. This effectively short-circuits execution of Interceptors' :enter functions and begins executing the :leave functions.

Removes all remaining interceptors from context's execution queue.
This effectively short-circuits execution of Interceptors' :enter
functions and begins executing the :leave functions.
raw docstring

whenclj/s

(when f pred)

Modifies interceptor function to only run on ctx if pred returns true'ish

Modifies interceptor function to only run on ctx if pred returns true'ish
raw docstring

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

× close