execution-engine
Version:
A TypeScript library for tracing and visualizing code execution workflows.
14 lines • 737 B
TypeScript
import { CacheOptions } from '../common/models/executionCache.model';
/**
* 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.
*
* @param options - Caching configuration specifying TTL, cache key generation, cache management, and optional logging.
* @returns A method decorator that applies caching logic.
*
* @remarks
* - Cache behavior can be customized via `cacheKey`, `ttl`, and `cacheHandler`.
* - Errors are thrown immediately and **not cached** to allow retries.
*/
export declare function cache(options: CacheOptions): MethodDecorator;
//# sourceMappingURL=cache.decorator.d.ts.map