Files
Cleanuparr/code/backend/Cleanuparr.Infrastructure/Features/Notifications/Consumers/NotificationConsumer.cs
T
2026-10-09 02:10:04 +03:00

22 lines
736 B
C#

using Cleanuparr.Infrastructure.Features.Messaging;
using Cleanuparr.Infrastructure.Features.Notifications.Models;
namespace Cleanuparr.Infrastructure.Features.Notifications.Consumers;
/// <summary>
/// Sends one queued notification to its configured providers.
/// </summary>
public sealed class NotificationConsumer : IMessageHandler<NotificationMessage>
{
private readonly NotificationService _notificationService;
public NotificationConsumer(NotificationService notificationService)
{
_notificationService = notificationService;
}
/// <inheritdoc />
public Task HandleAsync(NotificationMessage message) =>
_notificationService.SendNotificationAsync(message.EventType, message.Context);
}