Creates a new isolated effect runner.
Provide kv to enable persistent cache reads/writes for effects created
with cache: true. Without kv, the runner still deduplicates in-flight
calls and memoizes completed values in memory for its lifetime.
Optionaloptions: RunnerOptions = {}
Optional iso-kv compatible cache and
logger used by effect handlers.
Calls an effect with validated input and returns its validated output.
The call pipeline is:
context.cache was set to false.Clears runner-local memoized outputs.
This only clears completed in-memory values. In-flight promises continue to
resolve normally, rate-limit windows are preserved, and persistent iso-kv
cache entries are intentionally left untouched.
Optionaleffect: Effect<any, any>
Optional effect to clear. Omit to clear memoized outputs for all effects registered in this runner.
Returns a snapshot of this runner's counters for an effect.
The returned object is a copy, so mutating it will not affect runner state. Counters are scoped to this runner and do not include activity from other runners using the same effect descriptor.
Effect whose stats should be returned.
Persistent cache reads that produced valid output.
Persistent cache writes.
Handler executions. Cache and memo hits do not increment this counter.
Calls that reused an in-flight same-input promise.
Calls rejected because validation, cache, or handler execution failed.
Persistent cache entries removed because output validation failed.
Calls served from runner-local memory.
Executes effects with per-runner state.
A runner owns the mutable behavior around otherwise inert effect descriptors: validated input memoization, same-input in-flight deduplication, microtask collection, fixed-window rate limiters, nested effect calls, optional persistent cache access, and lightweight stats. Create separate runners when you want separate memo/cache state for tests, tenants, requests, or isolated workflows.