execution-engine
Version:
A TypeScript library for tracing and visualizing code execution workflows.
14 lines • 747 B
TypeScript
import { CacheOptions } from '../common/models/executionCache.model';
export declare const cacheStoreKey: unique symbol;
/**
* Caches function results to avoid redundant expensive computations
* If the result is already cached, it returns the cached value; otherwise, it executes the function and stores the result.
*
* This is useful for optimizing expensive computations or API calls by reducing duplicate executions.
* @remarks
* - Errors are thrown immediately and **not cached** to allow retries.
*/
export declare function executeCache<O>(blockFunction: (...params: unknown[]) => O | Promise<O>, inputs: Array<unknown>, options: CacheOptions & {
functionId: string;
}): Promise<Promise<O> | O>;
//# sourceMappingURL=cache.d.ts.map