Interface IMessageChannel
An abstraction that defines methods for sending messages;
public interface IMessageChannel : IServiceNameAware
- Inherited Members
Methods
Send(IMessage)
Send a message to this channel. If the message is sent successfuly, the method returns true. If the message cannot be sent due to a non-fatal reason, the method returns false. The method may also throw a Exception in case of non-recoverable errors. This method may block indefinitely, depending on the implementation.
bool Send(IMessage message)
Parameters
message
IMessagethe message to send
Returns
- bool
true if the message is sent
Send(IMessage, int)
Send a message, blocking until either the message is accepted or the specified timeout period elapses.
bool Send(IMessage message, int timeout)
Parameters
Returns
- bool
true if the message is sent
SendAsync(IMessage, CancellationToken)
Send a message to this channel.
ValueTask<bool> SendAsync(IMessage message, CancellationToken cancellationToken = default)
Parameters
message
IMessagethe message to send
cancellationToken
CancellationTokentoken used to signal cancellation