public void AddNotification(TargetedNotification notification) { lock (_notifications) { _sequenceNumber++; if (_notifications.Count == _maxSize) { _notifications.RemoveLast(); } _notifications.AddFirst(new KeyValuePair <int, TargetedNotification>(_sequenceNumber, notification)); } }
public void AddNotification(TargetedNotification notification) { lock (_notifications) { _sequenceNumber++; if (_notifications.Count == _maxSize) { _notifications.RemoveLast(); } _notifications.AddFirst(new KeyValuePair<int, TargetedNotification>(_sequenceNumber, notification)); } }
/// <summary> /// Constructs a notification query result. /// </summary> /// <param name="earliestSequenceNumber">The sequence number of the earliest notification still in the buffer.</param> /// <param name="nextSequenceNumber">The sequence number of the next notification available for querying.</param> /// <param name="targetedNotifications">The notifications resulting from the query, and the listeners they correspond to. This array can be empty.</param> public NotificationResult(int earliestSequenceNumber, int nextSequenceNumber, TargetedNotification[] targetedNotifications) { _earliestSequenceNumber = earliestSequenceNumber; _nextSequenceNumber = nextSequenceNumber; _targetedNotifications = targetedNotifications; }