NamedCacheInvokeT, P Method (IFilter, P, ActionT, P, EvalArgs, 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 void Invoke<T, P>(
	IFilter filter,
	P param,
	Action<T, P, EvalArgs> evalMethod,
	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 this 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: SystemActionT, P, EvalArgs
a delegate specifying the evaluation method to run for each target object specified via and filter. The Type in which evalMethod is defined must be serializable.

In this Invoke overload, the evalMethod is expected to take three arguments: an object of type T, referred to as the Target object, an object of type P which is the type of param, and a EvalArgs argument through which the method can indicate the disposition of the target object and determine the StateServerKey of the target object.

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(IFilter, P, ActionT, P, EvalArgs, 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.
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