Beispiel #1
0
 private void FeedUpdated(FeedUpdateOverview newFeedUpdate)
 {
     _feedUpdates.Add(newFeedUpdate);
     Delta.FeedUpdate = newFeedUpdate;
     GroupProcessedFeedUpdates(newFeedUpdate);
     TrimOldItems(_feedUpdates);
 }
Beispiel #2
0
 private void GroupProcessedFeedUpdates(FeedUpdateOverview newUpdate)
 {
     if (newUpdate != null && newUpdate.IsProcessed)
     {
         var oldFeedUpdate = _feedUpdates.Find(f => f.Sequence == newUpdate.Sequence && !f.IsProcessed);
         _feedUpdates.Remove(oldFeedUpdate);
     }
 }
 private static void FillProcessingEntry(FixtureProcessingEntry entry, FeedUpdateOverview update)
 {
     entry.Epoch = update.Epoch.ToString();
     entry.EpochChangeReasons = update.LastEpochChangeReason;
     entry.Exception = update.LastError;
     entry.IsUpdate = !update.IsSnapshot;
     entry.Sequence = update.Sequence.ToString();
     entry.Timestamp = update.Issued;
     entry.State = update.IsProcessed ? FixtureProcessingState.PROCESSED : FixtureProcessingState.PROCESSING;
 }
        private FeedUpdateOverview CreateFeedUpdate(StreamListenerEventArgs streamListenerArgs, bool isSnapshot = false)
        {
            var feedUpdate = new FeedUpdateOverview
            {
                Issued = DateTime.UtcNow,
                Sequence = streamListenerArgs.CurrentSequence,
                IsSnapshot = isSnapshot,
                Epoch = streamListenerArgs.Epoch,
                LastEpochChangeReason = streamListenerArgs.LastEpochChangeReason
            };

            return feedUpdate;
        }
Beispiel #5
0
 public static ServiceModel.FixtureProcessingEntry ToFixtureProcessingEntryServiceModel(this FeedUpdateOverview model)
 {
     return(new ServiceModel.FixtureProcessingEntry
     {
         Epoch = model.Epoch.ToString(),
         EpochChangeReasons = model.LastEpochChangeReason,
         Exception = model.LastError,
         IsUpdate = !model.IsSnapshot,
         Sequence = model.Sequence.ToString(),
         Timestamp = model.Issued,
         State = model.IsProcessed
             ? ServiceModelInterface.FixtureProcessingState.PROCESSED
             : ServiceModelInterface.FixtureProcessingState.PROCESSING
     });
 }