From cf14306c2b3f82a81f8d56669a71633b4d4b5fce Mon Sep 17 00:00:00 2001 From: marvin-borner@live.com Date: Mon, 16 Apr 2018 21:09:05 +0200 Subject: Main merge to user management system - files are now at /main/public/ --- .../vendor/react/event-loop/src/Timer/Timers.php | 109 --------------------- 1 file changed, 109 deletions(-) delete mode 100755 assets/php/vendor/react/event-loop/src/Timer/Timers.php (limited to 'assets/php/vendor/react/event-loop/src/Timer/Timers.php') diff --git a/assets/php/vendor/react/event-loop/src/Timer/Timers.php b/assets/php/vendor/react/event-loop/src/Timer/Timers.php deleted file mode 100755 index 17bbdac..0000000 --- a/assets/php/vendor/react/event-loop/src/Timer/Timers.php +++ /dev/null @@ -1,109 +0,0 @@ -timers = new SplObjectStorage(); - $this->scheduler = new SplPriorityQueue(); - } - - public function updateTime() - { - return $this->time = microtime(true); - } - - public function getTime() - { - return $this->time ?: $this->updateTime(); - } - - public function add(TimerInterface $timer) - { - $interval = $timer->getInterval(); - $scheduledAt = $interval + microtime(true); - - $this->timers->attach($timer, $scheduledAt); - $this->scheduler->insert($timer, -$scheduledAt); - } - - public function contains(TimerInterface $timer) - { - return $this->timers->contains($timer); - } - - public function cancel(TimerInterface $timer) - { - $this->timers->detach($timer); - } - - public function getFirst() - { - while ($this->scheduler->count()) { - $timer = $this->scheduler->top(); - - if ($this->timers->contains($timer)) { - return $this->timers[$timer]; - } - - $this->scheduler->extract(); - } - - return null; - } - - public function isEmpty() - { - return count($this->timers) === 0; - } - - public function tick() - { - $time = $this->updateTime(); - $timers = $this->timers; - $scheduler = $this->scheduler; - - while (!$scheduler->isEmpty()) { - $timer = $scheduler->top(); - - if (!isset($timers[$timer])) { - $scheduler->extract(); - $timers->detach($timer); - - continue; - } - - if ($timers[$timer] >= $time) { - break; - } - - $scheduler->extract(); - call_user_func($timer->getCallback(), $timer); - - if ($timer->isPeriodic() && isset($timers[$timer])) { - $timers[$timer] = $scheduledAt = $timer->getInterval() + $time; - $scheduler->insert($timer, -$scheduledAt); - } else { - $timers->detach($timer); - } - } - } -} -- cgit v1.2.3