private void Enqueue(PersistentSubscriptionResolvedEvent resolvedEvent) { _queue.Enqueue(resolvedEvent); if (Interlocked.CompareExchange(ref _isProcessing, 1, 0) == 0) { ThreadPool.QueueUserWorkItem(_ => ProcessQueue()); } }
private Task OnEventAppeared(EventStoreSubscription subscription, PersistentSubscriptionResolvedEvent resolvedEvent) { Enqueue(resolvedEvent); return(TaskEx.CompletedTask); }