Exemplo n.º 1
0
 public void BlockIfFullLoad()
 {
     while (SlidingDoors.Sum(d => d.Value.MessageCount) > _consumerConfig.FullLoadThreshold)
     {
         Thread.Sleep(_consumerConfig.WaitInterval);
         _logger.Warn($"working is full load sleep 1000 ms");
     }
 }
Exemplo n.º 2
0
 protected void BlockIfFullLoad()
 {
     while (SlidingDoors.Sum(d => d.Value.MessageCount) > ConsumerConfig.FullLoadThreshold)
     {
         Task.Delay(ConsumerConfig.WaitInterval).Wait();
         Logger.LogWarning($"{Id} is full load sleep 1000 ms");
     }
 }
Exemplo n.º 3
0
        protected void BlockIfFullLoad()
        {
            var remainMessageCount = 0;

            while ((remainMessageCount = SlidingDoors.Sum(d => d.Value.MessageCount)) > ConsumerConfig.FullLoadThreshold)
            {
                Task.Delay(ConsumerConfig.WaitInterval).Wait();
                Logger.LogWarning($"{Id} is full load sleep {ConsumerConfig.WaitInterval} ms, remain message count:{remainMessageCount} threshold:{ConsumerConfig.FullLoadThreshold}");
            }
        }