Пример #1
0
 private void StopThrottling(QueueTransition stateTransition)
 {
     if (stateTransition.ToStopThrottling)
     {
         this.Source.Pipeline.Scheduler.Thaw(this.Source.SyncContext);
         this.receiverDiagnosticsCollector.Value?.PipelineElementReceiverThrottle(false);
     }
 }
Пример #2
0
 private void StartThrottling(QueueTransition stateTransition)
 {
     // if queue is full (as decided between local policy and global policy), lock the emitter.syncContext (which we might already own) until we make more room
     if (stateTransition.ToStartThrottling)
     {
         this.counters?.Increment(ReceiverCounters.ThrottlingRequests);
         this.Source.Pipeline.Scheduler.Freeze(this.Source.SyncContext);
         this.receiverDiagnosticsCollector.Value?.PipelineElementReceiverThrottle(true);
     }
 }