Click or drag to resize

EvaluatorGroupCallAndMemoizeTResult Method (EvaluatorGroupCallback0TResult)

Optimizes calls to a callback that is expected to be called multiple times so that future calls with the same parameters return a cached result rather than actually invoking the callback again. The first time this method is called with a particular set of parameters, the callback is invoked and the result is stored in the evaluator group. The second and successive times this method is called with the same parameters, the cached result is returned without invoking the callback.

Namespace:  AGI.Foundation
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.3.420.0 (24.3.420.0)
Syntax
public TResult CallAndMemoize<TResult>(
	EvaluatorGroupCallback0<TResult> callback
)

Parameters

callback
Type: AGI.FoundationEvaluatorGroupCallback0TResult
The method to invoke. This method must not have side-effects.

Type Parameters

TResult
The type of result returned by the method.

Return Value

Type: TResult
The result of invoking the callback.
Exceptions
See Also