Files
Umbraco-CMS/src/Umbraco.Core/Events/INotificationHandler.cs

40 lines
1.4 KiB
C#
Raw Normal View History

2020-12-23 11:02:50 +11:00
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System.Threading;
using System.Threading.Tasks;
using Umbraco.Cms.Core.Notifications;
2020-12-23 11:02:50 +11:00
namespace Umbraco.Cms.Core.Events
2020-12-23 11:02:50 +11:00
{
/// <summary>
/// Defines a handler for a notification.
/// </summary>
/// <typeparam name="TNotification">The type of notification being handled.</typeparam>
public interface INotificationHandler<in TNotification>
where TNotification : INotification
{
/// <summary>
/// Handles a notification
/// </summary>
/// <param name="notification">The notification</param>
void Handle(TNotification notification);
}
/// <summary>
/// Defines a handler for a async notification.
/// </summary>
/// <typeparam name="TNotification">The type of notification being handled.</typeparam>
public interface INotificationAsyncHandler<in TNotification>
where TNotification : INotification
2020-12-23 11:02:50 +11:00
{
/// <summary>
/// Handles a notification
/// </summary>
/// <param name="notification">The notification</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task HandleAsync(TNotification notification, CancellationToken cancellationToken);
}
}