IEventConsumer.cs 656 B

1234567891011121314151617181920
  1. using System;
  2. using System.Threading.Tasks;
  3. namespace MediaBrowser.Controller.Events
  4. {
  5. /// <summary>
  6. /// An interface representing a type that consumes events of type <c>T</c>.
  7. /// </summary>
  8. /// <typeparam name="T">The type of events this consumes.</typeparam>
  9. public interface IEventConsumer<in T>
  10. where T : EventArgs
  11. {
  12. /// <summary>
  13. /// A method that is called when an event of type <c>T</c> is fired.
  14. /// </summary>
  15. /// <param name="eventArgs">The event.</param>
  16. /// <returns>A task representing the consumption of the event.</returns>
  17. Task OnEvent(T eventArgs);
  18. }
  19. }