Class MessageModuleClient
Client for sending messages to message module objects.
public class MessageModuleClient
- Inheritance
-
MessageModuleClient
- Derived
- Inherited Members
Constructors
MessageModuleClient(Cache)
Protected constructor for use by derived (typed) MessageModuleClient class, where the caller supplies an existing Scaleout.Client.Cache instance.
protected MessageModuleClient(Cache cache)
Parameters
cacheCacheCache instance
MessageModuleClient(string, GridConnection)
Constructs a MessageModuleClient for the specified module name and grid connection.
public MessageModuleClient(string moduleName, GridConnection gridConnection)
Parameters
moduleNamestringName of the module to send messages to.
gridConnectionGridConnectionScaleout.Client GridConnection used to connect to the ScaleOut service.
Fields
_cache
protected Cache _cache
Field Value
- Cache
Methods
SendAsync<TSossObject>(string, byte[], TimeSpan?)
protected Task SendAsync<TSossObject>(string objectId, byte[] message, TimeSpan? timeout = null)
Parameters
Returns
Type Parameters
TSossObject
SendMessageAsync(string, byte[], TimeSpan?)
Sends a message to the specified object in the message module.
public virtual Task SendMessageAsync(string objectId, byte[] message, TimeSpan? timeout = null)
Parameters
objectIdstringID of the object to send a message to.
messagebyte[]Message payload.
timeoutTimeSpan?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 Scaleout.Client.TimeoutException or OperationCanceledException will be thrown (depending on whether the timeout occurred in the service or in the client process).
Returns
- Task
The task object representing the asynchronous operation.
Exceptions
- NotReadyException
The ScaleOut service is not yet ready to perform this operation, typically because there was no application registered to handle events for the specified
moduleName.- TimeoutException
The operation timed out in the server and the
timeoutelapsed.- OperationCanceledException
The operation timed out, typically because too many pending requests accumulated in the client and the
timeoutelapsed.- ScaleoutModuleException
An unhandled exception occurred in the module while processing the message.