Controller for receiving and sending generic messages to an intra-app-domain message bus
IMessageBusController
is defined in the Telligent.Evolution.Extensibility.Sockets.Version1
namespace of Telligent.Evolution.Platform.dll
Definition
interface IMessageBusController { event EventHandler<BusMessageReceivedEventArgs> Received { add; remove; } void Publish(string messageName, string messageData); Task PublishAsync(string messageName, string messageData, CancellationToken cancellationToken = null); }
Events
Received
Event raised when a generic message was raised by an instance of this type of ISocket, potentially on a different app domain.
Handler
void EventHandler<BusMessageReceivedEventArgs>(Object sender, BusMessageReceivedEventArgs e);
Methods
void Publish(string messageName, string messageData);
Publishes a generic message to the bus. Messages will be delivered to all other instances of this same type of ISocket, potentially across app domains. Messages are handled locally immediately on the same thread that raised them, bypassing the bus.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
messageName | string | Message Name | Required | ||
messageData | string | Message Data | Required |
Task PublishAsync(string messageName, string messageData, CancellationToken cancellationToken = null);
Publishes a generic message to the bus. Messages will be delivered to all other instances of this same type of ISocket, potentially across app domains. Messages are handled locally immediately on the same thread that raised them, bypassing the bus.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
messageName | string | Message Name | Required | ||
messageData | string | Message Data | Required | ||
cancellationToken | CancellationToken | Cancellation Token | Optional |
Return Type
Task