mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Create IEventConsumer and IEventManager
This commit is contained in:
parent
3ee940f7b3
commit
285af300f5
11
MediaBrowser.Controller/Events/IEventConsumer.cs
Normal file
11
MediaBrowser.Controller/Events/IEventConsumer.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MediaBrowser.Controller.Events
|
||||||
|
{
|
||||||
|
public interface IEventConsumer<in T>
|
||||||
|
where T : EventArgs
|
||||||
|
{
|
||||||
|
Task OnEvent(T eventArgs);
|
||||||
|
}
|
||||||
|
}
|
20
MediaBrowser.Controller/Events/IEventManager.cs
Normal file
20
MediaBrowser.Controller/Events/IEventManager.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MediaBrowser.Controller.Events
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An interface that handles eventing.
|
||||||
|
/// </summary>
|
||||||
|
public interface IEventManager
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Publishes an event.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="eventArgs">The event arguments.</param>
|
||||||
|
/// <typeparam name="T">The type of event.</typeparam>
|
||||||
|
/// <returns>A task representing the publishing of the event.</returns>
|
||||||
|
Task Publish<T>(T eventArgs)
|
||||||
|
where T : EventArgs;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user