public async Task Deliver(ScheduledCommand scheduled) { var command = scheduled.ToScheduledCommand <TAggregate>(); await scheduler.Deliver(command); scheduled.Result = command.Result; }
public async Task Deliver(ScheduledCommand scheduled) { var command = scheduled.ToScheduledCommand <TAggregate>(); //here we are setting the command.SequenceNumber to the scheduled.SequenceNumber because when //multiple commands are scheduled simultaniously against the same aggregate we were decrementing the //scheduled.SequenceNumber correctly, however we were not updating the command.SequenceNumber. //this is to prevent any side effects that may have been caused by that bug command.SequenceNumber = scheduled.SequenceNumber; await scheduler.Deliver(command); scheduled.Result = command.Result; }