Method SingleObjectInvoke
SingleObjectInvoke(TKey, string, byte[], string, TimeSpan?)
Invokes a server-side operation on a single, targeted StateServer object. The operation will be run remotely on the host where the object resides by an Invocation Grid worker process.
public InvokeResponse SingleObjectInvoke(TKey key, string operationId, byte[] payload, string invocationGrid, TimeSpan? invokeTimeout = null)
Parameters
key
TKeyIdentifier of the object in the cache.
operationId
stringArbitrary string identifying the invoked operation.
payload
byte[]Optional payload (typically a serialized object).
invocationGrid
stringThe name of the invocation grid to send the event to.
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. Use ResultObject to get the serialized object returned from the SingleObjectInvoke callback.
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 SingleObjectInvoke 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
-
SetSingleObjectInvokeHandler<TKey, TValue>(Cache<TKey, TValue>, Func<TKey, SingleObjectInvokeArgs, byte[]>)
SingleObjectInvoke(TKey, string, byte[], uint, TimeSpan?)
Invokes a server-side operation on a single, targeted StateServer object. The operation will be run remotely on the host where the object resides by an Invocation Grid worker process. (This overload is typically only used to support internal product infrastructure.)
public InvokeResponse SingleObjectInvoke(TKey key, string operationId, byte[] payload, uint igID, TimeSpan? invokeTimeout = null)
Parameters
key
TKeyIdentifier of the object in the cache.
operationId
stringArbitrary string identifying the invoked operation.
payload
byte[]Optional payload (typically a serialized object).
igID
uintThe identifier 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. Use ResultObject to get the serialized object returned from the SingleObjectInvoke callback.
Remarks
This overload is intended for use in rare scenarios when the service's internal numeric Invocation Grid identifier is known but its string name is not.
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 SingleObjectInvoke 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
-
SetSingleObjectInvokeHandler<TKey, TValue>(Cache<TKey, TValue>, Func<TKey, SingleObjectInvokeArgs, byte[]>)
SingleObjectInvoke(TKey, string, byte[], TimeSpan?)
Invokes a server-side operation on a single, targeted StateServer object. The operation will be run remotely on the host where the object resides.
public InvokeResponse SingleObjectInvoke(TKey key, string operationId, byte[] payload, TimeSpan? invokeTimeout = null)
Parameters
key
TKeyIdentifier of the object in the cache.
operationId
stringArbitrary string identifying the invoked operation.
payload
byte[]Optional payload (typically a serialized object).
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. Use ResultObject to get the serialized object returned from the SingleObjectInvoke callback.
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 SingleObjectInvoke 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
-
SetSingleObjectInvokeHandler<TKey, TValue>(Cache<TKey, TValue>, Func<TKey, SingleObjectInvokeArgs, byte[]>)