Example #1
0
 internal AggregateCommand(AggregateCommand previous)
 {
     this.CommandID = previous.CommandID;
     this.Stream = previous.Stream;
     this.Command = previous.Command;
     this.Timeout = previous.Timeout;
 }
Example #2
0
 internal AggregateCommand(AggregateCommand previous)
 {
     this.CommandID = previous.CommandID;
     this.Stream    = previous.Stream;
     this.Command   = previous.Command;
     this.Timeout   = previous.Timeout;
 }
Example #3
0
        public AggregateCommandEnvelope(Type aggregateType, AggregateCommand command)
        {
            Argument.RequiresNotNull(aggregateType, nameof(aggregateType));
            Argument.RequiresNotNull(command, nameof(command));

            this.AggregateType = aggregateType;
            this.Command       = command;
        }
Example #4
0
        public AggregateCommandEnvelope(Type aggregateType, AggregateCommand command)
        {
            Argument.RequiresNotNull(aggregateType, nameof(aggregateType));
            Argument.RequiresNotNull(command, nameof(command));

            this.AggregateType = aggregateType;
            this.Command = command;
        }
Example #5
0
 public RetryAggregateCommand(AggregateCommand command, int attemptNo)
     : base(command)
 {
     this.Attempt = attemptNo;
 }
Example #6
0
 public RetryAggregateCommand(AggregateCommand command, int attemptNo)
     : base(command)
 {
     this.Attempt = attemptNo;
 }
Example #7
0
        public void Next_command_is_processed_after_failure()
        {
            var reader = CreateWorkingReader();
            var writer = CreateWorkingWriter();
            var ag = Sys.ActorOf<Sample>();
            ag.Tell(new InitializeAggregate(reader, writer, new GlobalOptions()));

            var c1 = new AggregateCommand(TestStream, new PersistOne { Throw = true }, CommandTimeout);
            var c2 = new AggregateCommand(TestStream, new PersistOne(), CommandTimeout);

            ag.Tell(c1);
            ag.Tell(c2);

            ExpectMsg<CommandFailed>(c => c.CommandID == c1.CommandID);
            ExpectMsg<CommandSucceeded>(c => c.CommandID == c2.CommandID);
        }
Example #8
0
        public void Multiple_commands_are_processed_in_order()
        {
            var reader = CreateWorkingReader();
            var writer = CreateWorkingWriter();
            var ag = Sys.ActorOf<Sample>();
            ag.Tell(new InitializeAggregate(reader, writer, new GlobalOptions()));

            var c1 = new AggregateCommand(TestStream, new PersistOne(), CommandTimeout);
            var c2 = new AggregateCommand(TestStream, new PersistOne(), CommandTimeout);
            var c3 = new AggregateCommand(TestStream, new PersistOne(), CommandTimeout);

            ag.Tell(c1);
            ag.Tell(c2);
            ag.Tell(c3);

            ExpectMsg<CommandSucceeded>(c => c.CommandID == c1.CommandID);
            ExpectMsg<CommandSucceeded>(c => c.CommandID == c2.CommandID);
            ExpectMsg<CommandSucceeded>(c => c.CommandID == c3.CommandID);
        }