Skip to content

IAsyncResolver

Defined in: packages/engine/src/resolvers/ResolverRegistry.ts:33

Interface for async resolvers registered by packages/plugins.

Each resolver handles a domain of async data (currency rates, weather, stock prices, etc.). The preflight() method is called BEFORE VM execution to check if all data is cached. If not, it returns an AsyncCheckResult and the engine skips the VM, returning a Pending value instead.

readonly namespace: string;

Defined in: packages/engine/src/resolvers/ResolverRegistry.ts:35

Unique namespace for cache key scoping (e.g., “currency”, “weather”)

destroy(): void;

Defined in: packages/engine/src/resolvers/ResolverRegistry.ts:57

Called when the resolver’s namespace is being unregistered. Clean up any in-flight promises, clear caches, unsubscribe.

void


optional preflight(
tokens,
bytecode,
packageId,
signal,
queryClient):
| AsyncCheckResult
| null;

Defined in: packages/engine/src/resolvers/ResolverRegistry.ts:51

Pre-flight check: called BEFORE VM execution.

Returns null if all data for this expression is cached and ready. Returns an AsyncCheckResult if async work is needed.

This method is synchronous, it only checks caches, never fetches. If data is missing, it creates a Promise and returns immediately.

ParameterTypeDescription
tokensToken[]The lexed tokens for the expression
bytecodeBytecodeProgramThe compiled bytecode program
packageIdstring-
signalAbortSignalAbortSignal for the current evaluation
queryClientQueryClient-

| AsyncCheckResult | null