Skip to main content

setCachedCalculation

@svenvw/fdm-source


@svenvw/fdm-source / fdm-core/src / setCachedCalculation

Function: setCachedCalculation()

setCachedCalculation<T_Input, T_Output>(fdm, calculationHash, calculationFunctionName, calculatorVersion, input, result): Promise<void>

Defined in: fdm-core/src/calculator.ts:81

Stores a calculation result in the cache.

Type Parameters

T_Input

T_Input extends object

The type of the input object for the calculation function.

T_Output

T_Output

The type of the calculation result.

Parameters

fdm

any

The FDM instance, providing database access.

calculationHash

string

The unique hash of the calculation.

calculationFunctionName

string

The name of the calculation function.

calculatorVersion

string

The version of the calculator.

input

T_Input

The input object used for the calculation.

result

T_Output

The computed result of the calculation.

Returns

Promise<void>

A promise that resolves when the cache operation is complete.