using Quasar.Common.Networking;
namespace Quasar.Common.Messages
{
///
/// Provides basic functionality to process messages.
///
public interface IMessageProcessor
{
///
/// Decides whether this message processor can execute the specified message.
///
/// The message to execute.
/// True if the message can be executed by this message processor, otherwise false.
bool CanExecute(IMessage message);
///
/// Decides whether this message processor can execute messages received from the sender.
///
/// The sender of a message.
/// True if this message processor can execute messages from the sender, otherwise false.
bool CanExecuteFrom(ISender sender);
///
/// Executes the received message.
///
/// The sender of this message.
/// The received message.
void Execute(ISender sender, IMessage message);
}
}