All aspects of actually executing transactions.
When an error is detected, fail
is called.
All aspects of actually executing transactions. When an error is detected, [[fail]] is called.
(compile env)
(compile env trx-canonical)
Compiles the given, previously expanded trx
using the current context.
See expand
.
Compiles the given, previously expanded `trx` using the current context. See [[expand]].
(exec env)
(exec env trx-compiled)
Runs the given, previously compiled trx
using the current context.
See compile
.
Runs the given, previously compiled `trx` using the current context. See [[compile]].
(expand env)
(expand env trx)
Expands the given trx
using the current context.
Expands the given `trx` using the current context.
(fail env err)
Must be called in case of failure, err
being an error map (see the convex.run.err
namespace).
Under $.catch/*stack*
in the context is a stack of error handling transactions. This functions pops
the next error handling transaction and prepends it to $.trx/*list*
, the list of transactions pending
for execution.
Also, error becomes available under $/*result*
.
This simple scheme allows sophisticated exception handling to be implemented from CVX, as seen in the
$.catch
acccount.
Must be called in case of failure, `err` being an error map (see the [[convex.run.err]] namespace). Under `$.catch/*stack*` in the context is a stack of error handling transactions. This functions pops the next error handling transaction and prepends it to `$.trx/*list*`, the list of transactions pending for execution. Also, error becomes available under `$/*result*`. This simple scheme allows sophisticated exception handling to be implemented from CVX, as seen in the `$.catch` acccount.
(juice env)
Computes consumed juice, extracting max-juice
from the current value.
Computes consumed juice, extracting [[max-juice]] from the current value.
Maximum juice value set on context prior to handling code.
Maximum juice value set on context prior to handling code.
(result env)
Extracts a result from the current context attached to env
.
Extracts a result from the current context attached to `env`.
After evaluating a transaction, the runner must check if the result is a special request.
It uses sreq-dispatch
to forward the result to the appropriate special request implementation, an "unknown"
implementation if it looks like a special request but is not implemented, or the "nil" implementation if it is not
a special request.
Implentations of special requests are in the [[convex.run.sreq]] namespace.
After evaluating a transaction, the runner must check if the result is a special request. It uses [[sreq-dispatch]] to forward the result to the appropriate special request implementation, an "unknown" implementation if it looks like a special request but is not implemented, or the "nil" implementation if it is not a special request. Implentations of special requests are in the [[convex.run.sreq]] namespace.
(sreq-dispatch result)
(sreq-dispatch _env result)
Dispatch function used by the sreq
multimethod.
Returns nil if the given result is not a special request.
Dispatch function used by the [[sreq]] multimethod. Returns nil if the given result is not a special request.
(trx env trx)
Evaluates trx
and forwards result to sreq
unless an error occured.
Evaluates `trx` and forwards result to [[sreq]] unless an error occured.
(trx+ env)
Executes transactions located in $.trx/*list*
in the context until that list becomes empty.
Executes transactions located in `$.trx/*list*` in the context until that list becomes empty.
(trx-track env trx)
Similar to trx
.
However, requests are not performed and juice consumption is tracked by going manually through
expand
, compile
, and exec
. Those are reported with the actual result in a map interned
under $/*result*
.
Similar to [[trx]]. However, requests are not performed and juice consumption is tracked by going manually through [[expand]], [[compile]], and [[exec]]. Those are reported with the actual result in a map interned under `$/*result*`.
(update-ctx env kw-phase f trx)
Refills the current context with maximum juice and calls f
with that context and trx
.
The context is then reattached to env
.
Refills the current context with maximum juice and calls `f` with that context and `trx`. The context is then reattached to `env`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close