コード例 #1
0
ファイル: CommandRecorder.cs プロジェクト: zedr0n/hycon-es
        public async Task Handle(T command)
        {
            _log.WriteLine("Entering handler of " + command.GetType().Name);
            try
            {
                await _handler.Handle(command);
            }
            catch (Exception e)
            {
                _log.WriteLine(e.Message);

                // retry the command in case of concurrency exception
                if (e is ConcurrencyException)
                {
                    await _handler.Handle(command);
                }
                throw;
            }

            command.Timestamp = _clock.GetCurrentInstant().ToUnixTimeMilliseconds();
            await _eventStore.AppendCommand(command);
        }
コード例 #2
0
 public Task Send(object command, CommandMetadata metadata)
 {
     return(_eventStore.AppendCommand(_streamName, command, metadata));
 }