From 236b5e8b29b32643e32c10dc447d0de69d6a365b Mon Sep 17 00:00:00 2001 From: Frank Wagner Date: Mon, 27 Feb 2023 18:57:19 +0100 Subject: [PATCH] Return Tasks in IOperationMessaging.DispatchTaskMessage (#2) --- .../Workflow/IOperationMessaging.cs | 2 +- .../Rebus.Operations.Core/Workflow/ProcessOperationSaga.cs | 2 +- .../Rebus.Operations.Core/Workflow/RebusOperationMessaging.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Rebus.Operations/Rebus.Operations.Abstractions/Workflow/IOperationMessaging.cs b/src/Rebus.Operations/Rebus.Operations.Abstractions/Workflow/IOperationMessaging.cs index 7ffe067..8844aaf 100644 --- a/src/Rebus.Operations/Rebus.Operations.Abstractions/Workflow/IOperationMessaging.cs +++ b/src/Rebus.Operations/Rebus.Operations.Abstractions/Workflow/IOperationMessaging.cs @@ -5,7 +5,7 @@ namespace Dbosoft.Rebus.Operations.Workflow; public interface IOperationMessaging { - void DispatchTaskMessage(object command, IOperationTask task); + Task DispatchTaskMessage(object command, IOperationTask task); Task DispatchTaskStatusEventAsync(string commandType, OperationTaskStatusEvent message); Task DispatchTaskStatusEventAsync(OperationTaskStatusEvent message); Task DispatchOperationStatusEventAsync(OperationStatusEvent operationStatusEvent); diff --git a/src/Rebus.Operations/Rebus.Operations.Core/Workflow/ProcessOperationSaga.cs b/src/Rebus.Operations/Rebus.Operations.Core/Workflow/ProcessOperationSaga.cs index 3ed3d1d..d2774fa 100644 --- a/src/Rebus.Operations/Rebus.Operations.Core/Workflow/ProcessOperationSaga.cs +++ b/src/Rebus.Operations/Rebus.Operations.Core/Workflow/ProcessOperationSaga.cs @@ -87,7 +87,7 @@ public async Task Handle(CreateNewOperationTaskCommand message) throw new InvalidOperationException($"unknown command type '{message.CommandType}'"); Data.Tasks.Add(message.TaskId, messageType.AssemblyQualifiedName!); - _workflow.Messaging.DispatchTaskMessage(command,task); + await _workflow.Messaging.DispatchTaskMessage(command,task); } diff --git a/src/Rebus.Operations/Rebus.Operations.Core/Workflow/RebusOperationMessaging.cs b/src/Rebus.Operations/Rebus.Operations.Core/Workflow/RebusOperationMessaging.cs index 245a923..8b46d5e 100644 --- a/src/Rebus.Operations/Rebus.Operations.Core/Workflow/RebusOperationMessaging.cs +++ b/src/Rebus.Operations/Rebus.Operations.Core/Workflow/RebusOperationMessaging.cs @@ -18,14 +18,14 @@ public RebusOperationMessaging(IBus bus, TaskDispatcher = taskDispatcher; } - public virtual void DispatchTaskMessage(object command, IOperationTask task) + public virtual Task DispatchTaskMessage(object command, IOperationTask task) { var messageType = command.GetType(); var outboundMessage = Activator.CreateInstance( typeof(OperationTaskSystemMessage<>).MakeGenericType(messageType), command, task.OperationId, task.InitiatingTaskId, task.Id); - _bus.SendLocal(outboundMessage); + return _bus.SendLocal(outboundMessage); } public Task DispatchTaskStatusEventAsync(string commandType, OperationTaskStatusEvent message)