using Elsa.Workflows.Runtime.Contracts; using Elsa.Workflows.Runtime.Notifications; using IEventPublisher = Elsa.Mediator.Contracts.IEventPublisher; namespace Elsa.Workflows.Runtime.Services; /// /// Relies on the to synchronously publish the received request as a domain event. /// public class SynchronousTaskDispatcher : ITaskDispatcher { private readonly IEventPublisher _eventPublisher; /// /// Constructor. /// public SynchronousTaskDispatcher(IEventPublisher eventPublisher) => _eventPublisher = eventPublisher; /// public async Task DispatchAsync(RunTaskRequest request, CancellationToken cancellationToken = default) => await _eventPublisher.PublishAsync(request, cancellationToken); }