Files
i2p 773d05f8f1
Pulsar .NET 9.0 Windows Release / build (push) Waiting to run
Mirror to Codeberg and Gitea / mirror (push) Waiting to run
initial commit
2026-08-27 10:57:58 -06:00

33 lines
1.3 KiB
C#

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