Esempio n. 1
0
        private void EnqueueDeliverEvent(EventRecord @event, EventRecord link, float progress,
                                         ref long sequenceNumber)
        {
            if (link != null)
            {
                throw new Exception();
            }
            var positionEvent = @event;

            if (positionEvent.EventNumber != sequenceNumber)
            {
                // This can happen when the original stream has $maxAge/$maxCount set
                _publisher.Publish(new ReaderSubscriptionMessage.Faulted(EventReaderCorrelationId, string.Format(
                                                                             "Event number {0} was expected in the stream {1}, but event number {2} was received. This may happen if events have been deleted from the beginning of your stream, please reset your projection.",
                                                                             sequenceNumber, SystemStreams.StreamsStream, positionEvent.EventNumber), GetType()));
                return;
            }

            sequenceNumber = positionEvent.EventNumber + 1;

            var item = new DeliverEventOutItem(_ioDispatcher, this, @event, @progress);

            EnqueueReadMetaStreamItem(item);
            Enqueue(item);
        }
        private void EnqueueDeliverEvent(EventRecord @event, EventRecord link, float progress, ref int sequenceNumber)
        {
            if (link != null)
            {
                throw new Exception();
            }
            var positionEvent = @event;

            if (positionEvent.EventNumber != sequenceNumber)
            {
                throw new InvalidOperationException(
                          string.Format(
                              "Event number {0} was expected in the stream {1}, but event number {2} was received",
                              sequenceNumber, SystemStreams.StreamsStream, positionEvent.EventNumber));
            }
            sequenceNumber = positionEvent.EventNumber + 1;

            var item = new DeliverEventOutItem(_ioDispatcher, this, @event, @progress);

            EnqueueReadMetaStreamItem(item);
            Enqueue(item);
        }
Esempio n. 3
0
 private void EnqueueReadMetaStreamItem(DeliverEventOutItem item)
 {
     _readMetaStreamItemsQueue.Enqueue(item);
 }