Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented workflow sink module #3571

Merged
merged 25 commits into from
Jan 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor
  • Loading branch information
grkngrn committed Dec 30, 2022
commit 60e3081b5479c8872467943e6bfaf97269960bd4
10 changes: 0 additions & 10 deletions src/modules/Elsa.Workflows.Sinks/Contracts/ISinkTransport.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading;
using System.Threading.Tasks;
using Elsa.Common.Services;
using Elsa.Mediator.Services;
using Elsa.Workflows.Runtime.Notifications;
using Elsa.Workflows.Sinks.Contracts;
Expand All @@ -9,15 +10,15 @@ namespace Elsa.Workflows.Sinks.Implementations;

public class WorkflowExecutedNotificationHandler : INotificationHandler<WorkflowExecuted>
{
private readonly ISinkTransport _sinkTransport;
private readonly ITransport<ExportWorkflowSinkMessage> _transport;

public WorkflowExecutedNotificationHandler(ISinkTransport sinkTransport)
public WorkflowExecutedNotificationHandler(ITransport<ExportWorkflowSinkMessage> transport)
{
_sinkTransport = sinkTransport;
_transport = transport;
}

public async Task HandleAsync(WorkflowExecuted notification, CancellationToken cancellationToken)
{
await _sinkTransport.SendAsync(new ExportWorkflowSinkMessage(notification.WorkflowState), cancellationToken);
await _transport.SendAsync(new ExportWorkflowSinkMessage(notification.WorkflowState), cancellationToken);
}
}