public void TearDown()
 {
     _bus           = null;
     _manager       = null;
     _correlationID = Guid.Empty;
     _prepareAck    = null;
     _commitAck     = null;
 }
 public void SetUp()
 {
     _bus           = new FakePublisher();
     _manager       = new TwoPhaseCommitRequestManager(_bus, 2, 2);
     _correlationID = Guid.NewGuid();
     _manager.Handle(new ReplicationMessage.WriteRequestCreated(_correlationID,
                                                                new NoopEnvelope(),
                                                                "test-stream",
                                                                -1,
                                                                new Event[0]));
     _prepareAck = new ReplicationMessage.PrepareAck(_correlationID, 0, PrepareFlags.TransactionBegin | PrepareFlags.TransactionEnd);
     _commitAck  = new ReplicationMessage.CommitAck(_correlationID, 0, 0);
 }
Example #3
0
        public void Handle(ReplicationMessage.CommitAck message)
        {
            if (_completed)
            {
                return;
            }

            _awaitingCommit -= 1;
            if (_awaitingCommit == 0)
            {
                CompleteSuccessRequest(message.CorrelationId, _eventStreamId, message.EventNumber);
            }
        }
 public void Handle(ReplicationMessage.CommitAck message)
 {
     DispatchInternal(message.CorrelationId, message);
 }