Example #1
0
 public EventReadResult(RecordedEvent @event)
 {
     Ensure.NotNull(@event, nameof(@event));
     Status      = EventReadStatus.Success;
     Stream      = @event.EventStreamId;
     EventNumber = @event.EventNumber;
     Event       = @event;
 }
Example #2
0
 private void EnqueuePushedEvent(StreamSubscription subscription, RecordedEvent e)
 {
     if (Verbose)
     {
         Log.Debug($"Catch-up Subscription {SubscriptionName} to {(IsSubscribedToAll ? "<all>" : StreamId)}: event appeared ({e.EventStreamId}, {e.EventNumber}, {e.EventType}).");
     }
     if (_liveQueue.Count >= MaxPushQueueSize)
     {
         EnqueueSubscriptionDropNotification(SubscriptionDropReason.ProcessingQueueOverflow, null);
         subscription.Unsubscribe();
     }
     _liveQueue.Enqueue(e);
     if (_allowProcessing)
     {
         EnsureProcessingPushQueue();
     }
 }
        /// <summary>
        /// Try to process a single <see cref="T:EventStore.ClientAPI.ResolvedEvent" />.
        /// </summary>
        /// <param name="e">The <see cref="T:EventStore.ClientAPI.ResolvedEvent" /> to process.</param>
        protected override async Task TryProcessAsync(RecordedEvent e)
        {
            bool flag = false;

            if (e.EventNumber > _lastProcessedEventNumber)
            {
                try
                {
                    await EventAppeared(this, e).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    DropSubscription(SubscriptionDropReason.EventHandlerException, ex);
                    throw;
                }
                _lastProcessedEventNumber = e.EventNumber;
                flag = true;
            }
            if (!Verbose)
            {
                return;
            }
            Log.Debug("Catch-up Subscription {0} to {1}: {2} event ({3}, {4}, {5} @ {6}).", SubscriptionName, IsSubscribedToAll ?  "<all>" : StreamId, flag ? "processed" :"skipping", e.EventStreamId, e.EventNumber, e.EventType, e.EventNumber);
        }
Example #4
0
 /// <summary>
 /// Try to process a single <see cref="T:ReactiveDomain.ResolvedEvent" />.
 /// </summary>
 /// <param name="e">The <see cref="T:ReactiveDomain.ResolvedEvent" /> to process.</param>
 protected abstract Task TryProcessAsync(RecordedEvent e);