Пример #1
0
 private function trim()
 {
     if (count($this->queue) > $this->bufferSize) {
         array_shift($this->queue);
     }
     if (null !== $this->scheduler) {
         $now = $this->scheduler->now();
         while (count($this->queue) > 0 && $now - $this->queue[0]["interval"] > $this->windowSize) {
             array_shift($this->queue);
         }
     }
 }