private void ProcessDomainEventHandledMessage(DomainEventHandledMessage message)
 {
     if (_commandTaskDict.TryRemove(message.CommandId, out CommandTaskCompletionSource commandTaskCompletionSource))
     {
         var commandResult = new CommandResult(CommandStatus.Success, message.CommandId, message.AggregateRootId, message.CommandResult, message.CommandResult != null ? typeof(string).FullName : null);
         if (commandTaskCompletionSource.TaskCompletionSource.TrySetResult(commandResult))
         {
             _logger.InfoFormat("Command result return, {0}", commandResult);
         }
     }
 }
Пример #2
0
        private void ProcessDomainEventHandledMessage(DomainEventHandledMessage message)
        {
            CommandTaskCompletionSource commandTaskCompletionSource;

            if (_commandTaskDict.TryRemove(message.CommandId, out commandTaskCompletionSource))
            {
                var commandResult = new CommandResult(CommandStatus.Success, message.CommandId, message.AggregateRootId, null, null);
                if (commandTaskCompletionSource.TaskCompletionSource.TrySetResult(new AsyncTaskResult <CommandResult>(AsyncTaskStatus.Success, commandResult)))
                {
                    _logger.DebugFormat("Command result setted, commandId:{0}, commandStatus:{1}, aggregateRootId:{2}", message.CommandId, CommandStatus.Success, message.AggregateRootId);
                }
            }
        }
Пример #3
0
 private void ProcessDomainEventHandledMessage(DomainEventHandledMessage message)
 {
     CommandTaskCompletionSource commandTaskCompletionSource;
     if (_commandTaskDict.TryRemove(message.CommandId, out commandTaskCompletionSource))
     {
         var commandResult = new CommandResult(CommandStatus.Success, message.CommandId, message.AggregateRootId, message.CommandResult, message.CommandResult != null ? typeof(string).FullName : null);
         if (commandTaskCompletionSource.TaskCompletionSource.TrySetResult(new AsyncTaskResult<CommandResult>(AsyncTaskStatus.Success, commandResult)))
         {
             if (_logger.IsDebugEnabled)
             {
                 _logger.DebugFormat("Command result return, {0}", commandResult);
             }
         }
     }
 }
Пример #4
0
 private void ProcessDomainEventHandledMessage(DomainEventHandledMessage message)
 {
     CommandTaskCompletionSource commandTaskCompletionSource;
     if (_commandTaskDict.TryRemove(message.CommandId, out commandTaskCompletionSource))
     {
         var commandResult = new CommandResult(CommandStatus.Success, message.CommandId, message.AggregateRootId, null, null);
         if (commandTaskCompletionSource.TaskCompletionSource.TrySetResult(new AsyncTaskResult<CommandResult>(AsyncTaskStatus.Success, commandResult)))
         {
             _logger.DebugFormat("Command result setted, commandId:{0}, commandStatus:{1}, aggregateRootId:{2}", message.CommandId, CommandStatus.Success, message.AggregateRootId);
         }
     }
 }
Пример #5
0
 private void ProcessDomainEventHandledMessage(DomainEventHandledMessage message)
 {
     CommandTaskCompletionSource commandTaskCompletionSource;
     if (_commandTaskDict.TryGetValue(message.CommandId, out commandTaskCompletionSource))
     {
         commandTaskCompletionSource.TaskCompletionSource.TrySetResult(new CommandResult(CommandStatus.Success, message.CommandId, message.AggregateRootId, 0, null));
     }
     if (message.IsProcessCompletedEvent && !string.IsNullOrEmpty(message.ProcessId))
     {
         TaskCompletionSource<ProcessResult> processTaskCompletionSource;
         if (_processTaskDict.TryGetValue(message.ProcessId, out processTaskCompletionSource))
         {
             processTaskCompletionSource.TrySetResult(new ProcessResult(message.ProcessId));
         }
     }
 }