aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Events/IEventManager.cs
blob: 074e3f1fe429bd55a1a46539889c22341b590d47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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>
        void Publish<T>(T eventArgs)
            where T : EventArgs;

        /// <summary>
        /// Publishes an event asynchronously.
        /// </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 PublishAsync<T>(T eventArgs)
            where T : EventArgs;
    }
}