Class MessengerExtensions
- Namespace
- Acuit.Pinpoint.Workstation.Messaging
- Assembly
- Acuit.Pinpoint.Workstation.Abstractions.dll
Extension members for IMessenger.
public static class MessengerExtensions
- Inheritance
-
MessengerExtensions
- Inherited Members
Methods
SendAsync<TMessage>(IMessenger, TMessage)
Sends a message of the specified type to all registered recipients and waits for any asynchronous handlers to complete.
public static Task<TMessage> SendAsync<TMessage>(this IMessenger messenger, TMessage message) where TMessage : class, IAsyncHandlingMessage
Parameters
messengerIMessengermessageTMessageThe message to send.
Returns
- Task<TMessage>
The task object representing the asynchronous operation.
Type Parameters
TMessageThe type of message to send.
Remarks
Once the operation completes, the Result property on the returned task object contains the message that was sent (i.e.,
message).
Exceptions
- ArgumentNullException
messageis null.
SendAsync<TMessage, TToken>(IMessenger, TMessage, TToken)
Sends a message of the specified type to all registered recipients and waits for any asynchronous handlers to complete.
public static Task<TMessage> SendAsync<TMessage, TToken>(this IMessenger messenger, TMessage message, TToken token) where TMessage : class, IAsyncHandlingMessage where TToken : notnull, IEquatable<TToken>
Parameters
messengerIMessengermessageTMessageThe message to send.
tokenTTokenThe token indicating what channel to use.
Returns
- Task<TMessage>
The task object representing the asynchronous operation.
Type Parameters
TMessageThe type of message to send.
TTokenThe type of token to identify what channel to use to send the message.
Remarks
Once the operation completes, the Result property on the returned task object contains the message that was sent (i.e.,
message).
Exceptions
- ArgumentNullException
messageis null.- ArgumentNullException
tokenis null.