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