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

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

            this.AggregateType = aggregateType;
            this.Command = command;
        }
Esempio n. 5
0
 public RetryAggregateCommand(AggregateCommand command, int attemptNo)
     : base(command)
 {
     this.Attempt = attemptNo;
 }
Esempio n. 6
0
 public RetryAggregateCommand(AggregateCommand command, int attemptNo)
     : base(command)
 {
     this.Attempt = attemptNo;
 }
Esempio n. 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);
        }
Esempio n. 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);
        }