You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sonarr/NzbDrone.Common/Eventing/IHandle.cs

40 lines
1.3 KiB

using System.Linq;
namespace NzbDrone.Common.Eventing
{
/// <summary>
/// Denotes a class which can handle a particular type of message.
/// </summary>
/// <typeparam name = "TEvent">The type of message to handle.</typeparam>
public interface IHandle<TEvent> : IHandle where TEvent : IEvent
{
/// <summary>
/// Handles the message synchronously.
/// </summary>
/// <param name = "message">The message.</param>
void Handle(TEvent message);
}
/// <summary>
/// Denotes a class which can handle a particular type of message.
/// </summary>
/// <typeparam name = "TEvent">The type of message to handle.</typeparam>
public interface IHandleAsync<TEvent> : IHandleAsync where TEvent : IEvent
{
/// <summary>
/// Handles the message asynchronously.
/// </summary>
/// <param name = "message">The message.</param>
void HandleAsync(TEvent message);
}
/// <summary>
/// A marker interface for classes that subscribe to messages.
/// </summary>
public interface IHandle { }
/// <summary>
/// A marker interface for classes that subscribe to messages.
/// </summary>
public interface IHandleAsync : IHandle { }
}