Expand description
§Evaluation Primitives
Free functions and types that support JSONLogic evaluation in the engine.
Built-in function execution lives on each config type (MapConfig::execute,
ValidationConfig::execute, …) — this module just provides the shared
evaluation machinery they all build on.
The bump arena is held in a thread-local cell on each Tokio worker. Per
call, the arena is rewound via Bump::reset (constant-time, retains chunks)
before the eval. Chunks accumulate to fit the workload’s high-water mark
and persist across calls — no per-task malloc/free churn. Profiling
showed per-task Bump::with_capacity malloc was the dominant cost when
arena sizing was tuned for realistic workloads; thread-local reuse
amortizes that to zero in steady state.
ArenaContext (below) extends this further for mutating tasks (map):
the message context is to_arena’d once per task call into a depth‑2
cache, and subsequent writes only re‑arena the dirtied subtree — typically
data.MT103 while the heavy data.input stays cached.
Functions§
- evaluate_
condition - Evaluate a workflow or task condition using a cached compiled logic
expression. Returns
truewhencondition_indexisNone(no condition is treated as “always run”). Evaluation errors are logged and downgraded tofalse— a condition that fails to evaluate skips its task/workflow rather than aborting the whole message. - evaluate_
condition_ in_ arena - Same as
evaluate_conditionbut evaluates against an arena-residentDataValueand an existingBump. Used inside awith_arenablock (the workflow sync-stretch path) to avoid re-entering the thread-local arenaRefCell::borrow_mut.