private void EnqueueMetrics(IEnumerable <string> metrics) { lock (_pendingLock) { if (_pendingMetrics == null || _pendingMetrics.Count == 0) { _pendingMetrics = metrics.Take(MaxQueueLength).ToList(); } else { _pendingMetrics.AddRange(metrics.Take(MaxQueueLength - _pendingMetrics.Count)); } if (ThrowOnQueueFull && _pendingMetrics.Count == MaxQueueLength) { var ex = new BosunQueueFullException(); if (HasExceptionHandler) { OnBackgroundException(ex); } else { throw ex; } } } }
private void OnPayloadDropped(BosunQueueFullException ex) { if (ShouldThrowException(ex)) { if (HasExceptionHandler) { OnBackgroundException(ex); } else { throw ex; } } }
void OnPayloadDropped(BosunQueueFullException ex) { SendExceptionToHandler(ex); }
void OnPayloadDropped(BosunQueueFullException ex) { PossiblyLogException(ex); }