Table of Contents

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

messenger IMessenger
message TMessage

The message to send.

Returns

Task<TMessage>

The task object representing the asynchronous operation.

Type Parameters

TMessage

The 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

message is 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

messenger IMessenger
message TMessage

The message to send.

token TToken

The token indicating what channel to use.

Returns

Task<TMessage>

The task object representing the asynchronous operation.

Type Parameters

TMessage

The type of message to send.

TToken

The 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

message is null.

ArgumentNullException

token is null.