using Elsa.Mediator;
using Elsa.Mediator.Contracts;
using Elsa.Workflows.Runtime.Notifications;
namespace Elsa.Workflows.Runtime;
///
/// Relies on the to publish the received request as a domain event from a background worker.
///
public class BackgroundTaskDispatcher(INotificationSender notificationSender) : ITaskDispatcher
{
///
public async Task DispatchAsync(RunTaskRequest request, CancellationToken cancellationToken = default)
{
await notificationSender.SendAsync(request, NotificationStrategy.Background, cancellationToken);
}
}