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