namespace zero.Communication;
///
/// Indicates a handler that can perform an action when a message of
/// a certain type is received. (could be an interface rather than concrete type)
///
public interface IMessageHandler where TMessage : IMessage
{
///
/// Method to invoke when a message of type TMessage is published
///
Task Handle(TMessage message);
}
///
/// Indicates a handler that can perform an action when a message of
/// a certain type is received. (could be an interface rather than concrete type)
///
public interface IBatchMessageHandler : IMessageHandler where TMessage : IMessage
{
///
/// Method to invoke when a batch of messages of type TMessage are published
///
Task HandleBatchAsync(IReadOnlyCollection message);
}