попытка рефактора 2
This commit is contained in:
@@ -59,11 +59,13 @@ public class PrepairedExecutionModule : IExecuteModule
|
|||||||
|
|
||||||
result.ContinueWith(_ =>
|
result.ContinueWith(_ =>
|
||||||
{
|
{
|
||||||
_serialisationModule.PostResponse(new FinalCommandExecution
|
//_serialisationModule.PostResponse(new FinalCommandExecution
|
||||||
{
|
//{
|
||||||
ExecutionId = exec.ExecutionId, Result = null, CommandId = command.CommandId,
|
// ExecutionId = exec.ExecutionId, Result = null, CommandId = command.CommandId,
|
||||||
ClientId = command.ClientId
|
// ClientId = command.ClientId
|
||||||
});
|
//});
|
||||||
|
PostFinalizedCallback(exec, null);
|
||||||
|
|
||||||
}, token);
|
}, token);
|
||||||
|
|
||||||
return exec;
|
return exec;
|
||||||
@@ -82,14 +84,26 @@ public class PrepairedExecutionModule : IExecuteModule
|
|||||||
|
|
||||||
result.ContinueWith(task =>
|
result.ContinueWith(task =>
|
||||||
{
|
{
|
||||||
var result = task.GetType().GetProperty("Result").GetValue(task);
|
var finalResult = task.GetType().GetProperty("Result").GetValue(task);
|
||||||
_serialisationModule.PostResponse(new FinalCommandExecution
|
//_serialisationModule.PostResponse(new FinalCommandExecution
|
||||||
{
|
//{
|
||||||
ExecutionId = exec.ExecutionId, Result = result, CommandId = command.CommandId,
|
// ExecutionId = exec.ExecutionId, Result = result, CommandId = command.CommandId,
|
||||||
ClientId = command.ClientId
|
// ClientId = command.ClientId
|
||||||
});
|
//});
|
||||||
|
PostFinalizedCallback(exec, finalResult);
|
||||||
}, token);
|
}, token);
|
||||||
|
|
||||||
return exec;
|
return exec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PostFinalizedCallback(ICommandExecution request, object result)
|
||||||
|
{
|
||||||
|
_serialisationModule.PostResponse(new FinalCommandExecution
|
||||||
|
{
|
||||||
|
ExecutionId = request.ExecutionId,
|
||||||
|
Result = request,
|
||||||
|
CommandId = request.CommandId,
|
||||||
|
ClientId = request.ClientId
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user