diff --git a/Tapeti.Flow/Default/FlowBindingMiddleware.cs b/Tapeti.Flow/Default/FlowBindingMiddleware.cs index 9053135..d3f6481 100644 --- a/Tapeti.Flow/Default/FlowBindingMiddleware.cs +++ b/Tapeti.Flow/Default/FlowBindingMiddleware.cs @@ -87,7 +87,10 @@ namespace Tapeti.Flow.Default private static Task HandleParallelResponse(IMessageContext context) { var flowHandler = context.DependencyResolver.Resolve(); - return flowHandler.Execute(context, new DelegateYieldPoint((a) => Task.CompletedTask)); + return flowHandler.Execute(context, new DelegateYieldPoint(async flowContext => + { + await flowContext.Store(); + })); } diff --git a/Tapeti.Flow/Default/FlowMessageMiddleware.cs b/Tapeti.Flow/Default/FlowMessageMiddleware.cs index 0dbd1c7..394ae0b 100644 --- a/Tapeti.Flow/Default/FlowMessageMiddleware.cs +++ b/Tapeti.Flow/Default/FlowMessageMiddleware.cs @@ -25,9 +25,6 @@ namespace Tapeti.Flow.Default await CallConvergeMethod(context, flowContext.ContinuationMetadata.ConvergeMethodName, flowContext.ContinuationMetadata.ConvergeMethodSync); - else if (flowContext.FlowState.Continuations.Count > 0) - // This is a parallel flow waiting for other continuations, always store the state - await flowContext.Store(); } else await next(); diff --git a/Test/MarcoController.cs b/Test/MarcoController.cs index a2df352..1010950 100644 --- a/Test/MarcoController.cs +++ b/Test/MarcoController.cs @@ -68,16 +68,13 @@ namespace Test } - /** - * The Visualizer could've been injected through the constructor, which is - * the recommended way. Just testing the injection middleware here. - */ - public async Task Marco(MarcoMessage message, Visualizer myVisualizer) + [Start] + public IYieldPoint TestParallelRequest() { Console.WriteLine(">> Marco (yielding with request)"); - await myVisualizer.VisualizeMarco(); StateTestGuid = Guid.NewGuid(); + Console.WriteLine($"Starting parallel request with StateTestGuid {StateTestGuid}"); return flowProvider.YieldWithParallelRequest() .AddRequestSync(new PoloConfirmationRequestMessage @@ -113,7 +110,7 @@ namespace Test private IYieldPoint ContinuePoloConfirmation() { Console.WriteLine("> ConvergePoloConfirmation (ending flow)"); - return flowProvider.EndWithResponse(new PoloMessage()); + return flowProvider.End(); } diff --git a/Test/Program.cs b/Test/Program.cs index aa33708..954e592 100644 --- a/Test/Program.cs +++ b/Test/Program.cs @@ -61,7 +61,8 @@ namespace Test connection.GetPublisher().Publish(new FlowEndController.PingMessage()); - container.GetInstance().Start(c => c.StartFlow, true); + //container.GetInstance().Start(c => c.StartFlow, true); + container.GetInstance().Start(c => c.TestParallelRequest); Thread.Sleep(1000);