示例#1
0
 /// <nodoc />
 public void Send(ContentLocationEventData eventData)
 {
     lock (_syncLock)
     {
         OnEvent(eventData);
     }
 }
示例#2
0
 private void HubOnEvent(ContentLocationEventData eventData)
 {
     using (_lock.AcquireReadLock())
     {
         if (_processing)
         {
             DispatchAsync(_context, eventData).GetAwaiter().GetResult();
             Interlocked.Increment(ref _sequenceNumber);
         }
         else
         {
             // Processing in suspended enqueue
             _queue.Add(eventData);
         }
     }
 }
示例#3
0
 internal void SendEventToMaster(ContentLocationEventData eventData)
 {
     GetMaster().LocalLocationStore.EventStore.DispatchAsync(this, eventData).GetAwaiter().GetResult();
 }
 /// <summary>
 /// <see cref="Send(ContentLocationEventData)"/>, without the lock. Used because of perf benchmarks
 /// getting contention on <see cref="_syncLock"/>. Since it is not part of the usual implementation of
 /// EventHub and not clear it is required for correctness, it is removed here.
 /// </summary>
 public void LockFreeSend(ContentLocationEventData eventData)
 {
     OnEvent(eventData);
 }