Method Invoke
- Namespace
- Scaleout.Client.QuerySupport
- Assembly
- Scaleout.Client.dll
Invoke<T>(IQueryable<T>, string, byte[], TimeSpan?)
Invokes a server-side parallel method invocation operation against those objects in the cache that satisfy
the filter specified by source
. The object filtering is performed on the server.
public static InvokeResponse Invoke<T>(this IQueryable<T> source, string operationId, byte[] param, TimeSpan? invokeTimeout = null)
Parameters
source
IQueryable<T>Specifies a query that will run on the server to pre-filter the objects presented to the user-defined operation identified by
operationId
.operationId
stringString identifier of the operation to invoke. Corresponds to an operation ID registered on the server side using SetInvokeHandler<TKey, TValue>(Cache<TKey, TValue>, string, InvokeHandler<TKey, TValue>).
param
byte[]Optional, arbitrary parameter to send to the invocation handler, serialized as a byte array.
invokeTimeout
TimeSpan?The amount of time allowed for this operation. After the
expires, the operation will be canceled. You may specify null or Zero if you want the operation to continue no matter how long it takes. If the timeout elapses, a TimeoutException or OperationCanceledException will be thrown (depending on whether the timeout occurred in the service or in the client process).
Returns
- InvokeResponse
InvokeResponse indicating the outcome of the operation. Result will be set to InvokeCompleted if successful or UnhandledExceptionInCallback if the callback handling the invoke operation in the server threw an unhandled exception. If the callback implementation returns a result, use ResultObject to get the serialized result object.
Type Parameters
T
Remarks
The Result property of the response will contain one of the following ServerResult outcomes:
ServerResult | Description |
---|---|
InvokeCompleted | The invoke operation completed successfully. Use ResultObject to get the serialized object returned from the Invoke callback. |
UnhandledExceptionInCallback | An unhandled exception was thrown from the callback handling the invocation event. Check ErrorData for details (this is typically a UTF8 encoded string, but if a different library processed the event on the server then another encoding may have been used). |
Exceptions
- NotReadyException
The ScaleOut service is not yet ready to perform this operation, typically because there was no application registered to handle events for this cache.
- TimeoutException
The operation timed out in the server and the
invokeTimeout
elapsed.- OperationCanceledException
The operation timed out, typically because too many pending requests accumulated in the client and the
invokeTimeout
elapsed.
- See Also
Invoke<T>(IQueryable<T>, string, byte[], string, TimeSpan?)
Invokes a server-side parallel method invocation operation against those objects in the cache that satisfy
the filter specified by source
. The object filtering is performed on the server.
public static InvokeResponse Invoke<T>(this IQueryable<T> source, string operationId, byte[] param, string invocationGrid, TimeSpan? invokeTimeout = null)
Parameters
source
IQueryable<T>Specifies a query that will run on the server to pre-filter the objects presented to the user-defined operation identified by
operationId
.operationId
stringString identifier of the operation to invoke. Corresponds to an operation ID registered on the server side using SetInvokeHandler<TKey, TValue>(Cache<TKey, TValue>, string, InvokeHandler<TKey, TValue>).
param
byte[]Optional, arbitrary parameter to send to the invocation handler, serialized as a byte array.
invocationGrid
stringThe name of the invocation grid that will handle the server-side invocation.
invokeTimeout
TimeSpan?The amount of time allowed for this operation. After the
expires, the operation will be canceled. You may specify null or Zero if you want the operation to continue no matter how long it takes. If the timeout elapses, a TimeoutException or OperationCanceledException will be thrown (depending on whether the timeout occurred in the service or in the client process).
Returns
- InvokeResponse
InvokeResponse indicating the outcome of the operation. Result will be set to InvokeCompleted if successful or UnhandledExceptionInCallback if the callback handling the invoke operation in the server threw an unhandled exception. If the callback implementation returns a result, use ResultObject to get the serialized result object.
Type Parameters
T
Remarks
The Result property of the response will contain one of the following ServerResult outcomes:
ServerResult | Description |
---|---|
InvokeCompleted | The invoke operation completed successfully. Use ResultObject to get the serialized object returned from the Invoke callback. |
UnhandledExceptionInCallback | An unhandled exception was thrown from the callback handling the invocation event. Check ErrorData for details (this is typically a UTF8 encoded string, but if a different library processed the event on the server then another encoding may have been used). |
Exceptions
- NotReadyException
The ScaleOut service is not yet ready to perform this operation, typically because there was no application registered to handle events for this cache.
- TimeoutException
The operation timed out in the server and the
invokeTimeout
elapsed.- OperationCanceledException
The operation timed out, typically because too many pending requests accumulated in the client and the
invokeTimeout
elapsed.
- See Also