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

enqueueclj/s

(enqueue ctx interceptors)

Adds interceptors to current context

Adds interceptors to current context
sourceraw 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
sourceraw docstring

executeclj/s

(execute ctx)
(execute ctx interceptors)

Executes a queue of Interceptors attached to the context. Context must be a map. Interceptors are added with exoscale.interceptor/enqueue.

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 onto 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 two arguments: the context and the error triggering the call. If you rethrow the error or assoc it into the context under :exoscale.interceptor/error (or via the exoscale.inceptor/error fn) other :error handlers will be triggered from the stack, if you just return the context it will resume triggering :leave functions.

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. Interceptors are added with
`exoscale.interceptor/enqueue`.

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 onto 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 two arguments: the context
and the error triggering the call. If you rethrow the error or assoc
it into the context under `:exoscale.interceptor/error` (or via the
`exoscale.inceptor/error` fn) other :error handlers will be
triggered from the stack, if you just return the context it will
resume triggering `:leave` functions.

If the `:error` reaches the end of the stack without being handled,
execute will throw it.
sourceraw 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
sourceraw docstring

inclj/s

(in f path)

Modifies interceptor stage to take in specified path

Modifies interceptor stage to *take in* specified path
sourceraw docstring

lensclj/s

(lens f path)

Modifies interceptor stage to take from path and return to path

Modifies interceptor stage to take from path and return to path
sourceraw docstring

outclj/s

(out f path)

Modifies interceptor stage to return at specified path

Modifies interceptor stage to *return at* specified path
sourceraw 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.
sourceraw docstring

whenclj/s

(when f pred)

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

Modifies interceptor stage to only run on ctx if pred returns true'ish
sourceraw docstring

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

× close