2021-05-06 15:39:20 -07:00
|
|
|
using System;
|
2020-08-13 17:29:14 -07:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Events
|
|
|
|
{
|
2020-08-24 17:34:33 -07:00
|
|
|
/// <summary>
|
|
|
|
/// An interface representing a type that consumes events of type <c>T</c>.
|
|
|
|
/// </summary>
|
|
|
|
/// <typeparam name="T">The type of events this consumes.</typeparam>
|
2020-08-13 17:29:14 -07:00
|
|
|
public interface IEventConsumer<in T>
|
|
|
|
where T : EventArgs
|
|
|
|
{
|
2020-08-24 17:34:33 -07:00
|
|
|
/// <summary>
|
|
|
|
/// A method that is called when an event of type <c>T</c> is fired.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="eventArgs">The event.</param>
|
|
|
|
/// <returns>A task representing the consumption of the event.</returns>
|
2020-08-13 17:29:14 -07:00
|
|
|
Task OnEvent(T eventArgs);
|
|
|
|
}
|
|
|
|
}
|