private void OnNSQMessageRecieved(NSQMessageEventArgs e) { System.Threading.Interlocked.Decrement(ref _readyCount); if (_readyCount == 0) { //signal failure?? return; } System.Threading.Interlocked.Increment(ref _processingCount); if (NSQMessageRecieved != null) { NSQMessageRecieved(this, e); } System.Threading.Interlocked.Decrement(ref _processingCount); System.Threading.Interlocked.Increment(ref _readyCount); try { UpdateReadyCount(); } catch (ArgumentException) { this.Stop(); } }
private void OnNSQMessageRecieved(NSQMessageEventArgs e) { if (_readyCount <= 0) { return; } if (System.Threading.Interlocked.Decrement(ref _readyCount) < 0) { System.Threading.Volatile.Write(ref _readyCount, 0); return; } System.Threading.Interlocked.Increment(ref _processingCount); var handler = this.NSQMessageRecieved; if (handler != null) { handler(this, e); } System.Threading.Interlocked.Decrement(ref _processingCount); System.Threading.Interlocked.Increment(ref _readyCount); UpdateReadyCount(); }
public void OnNSQMessageRecieved(NSQMessageEventArgs e) { var handler = this.NSQMessageReceived; if (handler != null) { handler(this, e); } }
private Task SignalMessageRecievedEventAsync(NSQMessageEventArgs e) { NSQProtocol _protocol = this; return(TaskEx.Run(() => { var handler = this.NSQMessageReceived; if (handler != null) { handler(_protocol, e); } })); }
private Task SignalMessageRecievedEventAsync(NSQMessageEventArgs e) { NSQProtocol _protocol = this; return Task.Run(() => { if (NSQMessageRecieved != null) NSQMessageRecieved(_protocol, e); }); }
private async void SignalMessageRecievedEvent(NSQMessageEventArgs e) { await SignalMessageRecievedEventAsync(e); }
public void OnNSQMessageRecieved(NSQMessageEventArgs e) { if (NSQMessageRecieved != null) NSQMessageRecieved(this, e); }
private Task SignalMessageRecievedEventAsync(NSQMessageEventArgs e) { NSQProtocol _protocol = this; return Task.Run(() => { var handler = this.NSQMessageReceived; if (handler != null) handler(_protocol, e); }); }
public void OnNSQMessageRecieved(NSQMessageEventArgs e) { var handler = this.NSQMessageReceived; if (handler != null) { handler(this, e); } }
private void NSQProtocolMessageRecieved(object sender, NSQMessageEventArgs e) { this.OnNSQMessageRecieved(e); }
private void OnNSQMessageRecieved(NSQMessageEventArgs e) { System.Threading.Interlocked.Decrement(ref _readyCount); if (_readyCount == 0) { return; } System.Threading.Interlocked.Increment(ref _processingCount); var handler = this.NSQMessageRecieved; if (handler != null) handler(this, e); System.Threading.Interlocked.Decrement(ref _processingCount); System.Threading.Interlocked.Increment(ref _readyCount); UpdateReadyCount(); }
private void NSQProtocolMessageRecieved(object sender, NSQMessageEventArgs e) { this.OnNSQMessageRecieved(e); }
private async void SignalMessageRecievedEvent(NSQMessageEventArgs e) { await SignalMessageRecievedEventAsync(e); }
private void OnNSQMessageRecieved(NSQMessageEventArgs e) { System.Threading.Interlocked.Decrement(ref _readyCount); if (_readyCount == 0) { //signal failure?? return; } System.Threading.Interlocked.Increment(ref _processingCount); if (NSQMessageRecieved != null) NSQMessageRecieved(this, e); System.Threading.Interlocked.Decrement(ref _processingCount); System.Threading.Interlocked.Increment(ref _readyCount); UpdateReadyCount(); }