2013-02-19 02:37:16 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Common.Eventing
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Denotes a class which can handle a particular type of message.
|
|
|
|
|
/// </summary>
|
2013-02-24 19:18:48 +00:00
|
|
|
|
/// <typeparam name = "TEvent">The type of message to handle.</typeparam>
|
|
|
|
|
public interface IHandle<TEvent> : IHandle where TEvent : IEvent
|
2013-02-19 02:37:16 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2013-03-05 06:25:05 +00:00
|
|
|
|
/// Handles the message synchronously.
|
2013-02-19 02:37:16 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name = "message">The message.</param>
|
2013-02-24 19:18:48 +00:00
|
|
|
|
void Handle(TEvent message);
|
2013-02-19 02:37:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-03-05 06:25:05 +00:00
|
|
|
|
/// <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);
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-19 02:37:16 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// A marker interface for classes that subscribe to messages.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IHandle { }
|
2013-03-05 06:25:05 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A marker interface for classes that subscribe to messages.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IHandleAsync : IHandle { }
|
2013-02-19 02:37:16 +00:00
|
|
|
|
}
|