Click or drag to resize

EvaluatorGroupCallAndMemoizeTResult, TParameter1, TParameter2 Method (EvaluatorGroupCallback2TResult, TParameter1, TParameter2, TParameter1, TParameter2)

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: 23.2.417.0 (23.2.417.0)
public TResult CallAndMemoize<TResult, TParameter1, TParameter2>(
	EvaluatorGroupCallback2<TResult, TParameter1, TParameter2> callback,
	TParameter1 parameter1,
	TParameter2 parameter2


Type: AGI.FoundationEvaluatorGroupCallback2TResult, TParameter1, TParameter2
The method to invoke. This method must not have side-effects.
Type: TParameter1
The first parameter to the callback.
Type: TParameter2
The second parameter to the callback.

Type Parameters

The type of result returned by the method.
The type of the first parameter to the callback.
The type of the second parameter to the callback.

Return Value

Type: TResult
The result of invoking the callback with the specified parameters.
See Also