private void OnTransactionChangedHandler(object sender, NotifyTransactionChangedEventArgs e) { if (e.Action == NotifyTransactionChangedAction.Commit) { var allEvents = changeCollector.GetAllChanges(); var transactionMock = new TransactionMock(e.Transaction.TransactionId, e.Transaction.CommitSequenceNumber); var trAppliedEvent = new NotifyTransactionAppliedEvent(transactionMock, allEvents); Byte[] byteStream = messageConverter.Serialize(trAppliedEvent); long currentLsn = e.Transaction.CommitSequenceNumber; // handle the failure of Task here. EventCollector.TransactionApplied(this.partitionId, previousLsn, currentLsn, byteStream); previousLsn = currentLsn; // Flush previous items. this.changeCollector.CreateNew(); } }
public NotifyDictionaryTransactionalEventArgsMock(TransactionMock transaction, NotifyDictionaryChangedAction action) : base(action) { this.transaction = transaction; }
public NotifyDictionaryItemAddedEventArgsMock(TransactionMock transaction, TKey key, TValue value) : base(transaction, NotifyDictionaryChangedAction.Add) { this.Key = key; this.Value = value; }
public NotifyDictionaryItemRemovedEventArgsMock(TransactionMock transaction, TKey key) : base(transaction, NotifyDictionaryChangedAction.Add) { this.Key = key; }
public NotifyTransactionAppliedEvent(TransactionMock transaction, List <ReliableCollectionChange> changes) { this.Transaction = transaction; this.Changes = changes; }