NamedCacheInvokeT, P, R Method (IFilter, P, FuncT, P, R, FuncR, R, R, TimeSpan)

ScaleOut Software NamedCache API
Invoke the user-defined evalMethod on all StateServer objects in this NamedCache that satisfy the Query(IFilter) constraints given by filter. Each method invocation will be passed the parameter object param.

Namespace:  Soss.Client
Assembly:  soss_namedcache (in soss_namedcache.dll) Version: 6.1.0.0
Syntax

public R Invoke<T, P, R>(
	IFilter filter,
	P param,
	Func<T, P, R> evalMethod,
	Func<R, R, R> mergeMethod,
	TimeSpan invokeTimeout
)

Parameters

filter
Type: Soss.ClientIFilter
A StateServer IFilter specifying the subset of objects within this NamedCache to evaluate. Specify null if all objects within the NamedCache are to be evaluated.
param
Type: P
an object to be passed to each evalMethod at evaluation time. param must be serializable and the assembly in which it is defined must be available on all StateServer hosts.
evalMethod
Type: SystemFuncT, P, R
a delegate specifying the evaluation method to run for each target object specified via filter. The Type in which evalMethod is defined must be serializable. The result type, R, of evalMethod must also be serializable.

In this Invoke overload, the evalMethod is expected to take two arguments: an object of type T, referred to as the Target object and an object of type P which is the type of param.

mergeMethod
Type: SystemFuncR, R, R
the method to be run following execution of evalMethods. This method is intended to perform a pairwise merge on the result objects output from multiple invocations of evalMethod.

The mergeMethod accepts two arguments which must have the same type, R, as the result type of the evalMethod. The mergeMethod merges its arguments into a single result instance of type R.

invokeTimeout
Type: SystemTimeSpan

The amount of time allowed for this Invoke operation. After the expires, the operation will be canceled. You may specify InfiniteInvokeTimeout if you want the operation to continue no matter how long it takes. However, temporary objects used while processing InvokeT, P, R(IFilter, P, FuncT, P, R, FuncR, R, R, TimeSpan) may accumulate if an error occurs and you specify InfiniteInvokeTimeout.

The value specified is currently adjusted up to the smallest number of seconds equal or greater than the TimeSpan value specified. This granularity may change in future implementations.

Type Parameters

T
the type of the Target object to be retrieved from StateServer and evaluated by the evalMethod. In order to be stored in StateServer, objects of type T must be serializable.
P
the type of the Parameter object passed to each Eval method invocation. P must be serializable.
R
the Type of the Results object returned from the evalMethod. Type R must be serializable.

Return Value

Type: R
the fully-merged result object after merging the result objects on each StateServer host and then merging the results from all hosts into a single object.
Remarks

The method invocations will occur on all hosts in parallel. All method invocations on a given host will share a single instance of the parameter object param.

If each host does not already have an attached client that has the necessary dependencies to perform invocations for that host and is registered for events for that NamedCache, an invocation grid (IG) should be used to handle parallel method invocations. IGs can be configured and loaded by using InvocationGridBuilder. This starts a dedicated invocation worker client for each host in the store. After an IG is loaded, it can be assigned to this NamedCache through the InvocationGrid property.

See Also

Reference