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.
Properties
Section titled “Properties”namespace
Section titled “namespace”readonly namespace: string;Defined in: packages/engine/src/resolvers/ResolverRegistry.ts:35
Unique namespace for cache key scoping (e.g., “currency”, “weather”)
Methods
Section titled “Methods”destroy()
Section titled “destroy()”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.
Returns
Section titled “Returns”void
preflight()?
Section titled “preflight()?”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
tokens | Token[] | The lexed tokens for the expression |
bytecode | BytecodeProgram | The compiled bytecode program |
packageId | string | - |
signal | AbortSignal | AbortSignal for the current evaluation |
queryClient | QueryClient | - |
Returns
Section titled “Returns”| AsyncCheckResult
| null