From 348947fb4c2a408ee1ff175f0f030b0a47ad7d87 Mon Sep 17 00:00:00 2001 From: Mikhail Mitrofanov Date: Sat, 22 Feb 2025 09:44:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B5=20=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=D1=8C=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=B4=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=81?= =?UTF-8?q?=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Example.Frontend/Program.cs | 2 ++ .../Implementation/Frontend/RequestExtractor.cs | 17 ++++++++++++++--- mROA/Implementation/NetworkMessage.cs | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Example.Frontend/Program.cs b/Example.Frontend/Program.cs index 63a25b2..842c0dd 100644 --- a/Example.Frontend/Program.cs +++ b/Example.Frontend/Program.cs @@ -27,6 +27,8 @@ class Program builder.Modules.Add(new BasicExecutionModule()); builder.Modules.Add(new CoCodegenMethodRepository()); builder.UseCollectableContextRepository(); + builder.Modules.Add(new CancellationRepository()); + builder.Build(); diff --git a/mROA/Implementation/Frontend/RequestExtractor.cs b/mROA/Implementation/Frontend/RequestExtractor.cs index 25232bb..6d58ce6 100644 --- a/mROA/Implementation/Frontend/RequestExtractor.cs +++ b/mROA/Implementation/Frontend/RequestExtractor.cs @@ -76,9 +76,20 @@ namespace mROA.Implementation.Frontend var result = _executeModule.Execute(request, _contextRepository, _representationModule); - var resultType = result is FinalCommandExecution - ? MessageType.FinishedCommandExecution - : MessageType.ExceptionCommandExecution; + var resultType = MessageType.Unknown; + + switch (result) + { + case FinalCommandExecution: + resultType = MessageType.FinishedCommandExecution; + break; + case AsyncCommandExecution: + resultType = MessageType.AsyncCommandExecution; + break; + case ExceptionCommandExecution: + resultType = MessageType.ExceptionCommandExecution; + break; + } _representationModule.PostCallMessage(request.Id, resultType, result, result.GetType()); } diff --git a/mROA/Implementation/NetworkMessage.cs b/mROA/Implementation/NetworkMessage.cs index 6cb302b..7b04c12 100644 --- a/mROA/Implementation/NetworkMessage.cs +++ b/mROA/Implementation/NetworkMessage.cs @@ -15,6 +15,6 @@ namespace mROA.Implementation public enum MessageType { - Unknown, FinishedCommandExecution, ExceptionCommandExecution, AsyncCancelCommandExecution, CallRequest, IdAssigning, CancelRequest + Unknown, FinishedCommandExecution, ExceptionCommandExecution, AsyncCommandExecution, CallRequest, IdAssigning, CancelRequest } } \ No newline at end of file