Beispiel #1
0
        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;
                    }
                }
            }
        }
Beispiel #2
0
 private void OnPayloadDropped(BosunQueueFullException ex)
 {
     if (ShouldThrowException(ex))
     {
         if (HasExceptionHandler)
         {
             OnBackgroundException(ex);
         }
         else
         {
             throw ex;
         }
     }
 }
Beispiel #3
0
 void OnPayloadDropped(BosunQueueFullException ex)
 {
     SendExceptionToHandler(ex);
 }
 void OnPayloadDropped(BosunQueueFullException ex)
 {
     PossiblyLogException(ex);
 }