/// <nodoc /> public void Send(ContentLocationEventData eventData) { lock (_syncLock) { OnEvent(eventData); } }
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); } } }
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); }