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>1]㮧aU?a=Nqd,qLrd@sFZDDnԭ5!`@akᬪGUkD+ ۸q&^?P'~?`5͈#^U1M wb, mľW155g+̿1%&CD1~r\_qj ŔMg6$֟Z֫g6/[oO\U!h~^Ϥ;ޏc{x_ 7$>\IiRJpy1 ĩ̋NɉM!*bS$8QАqopCCJ*ïzpWc3N)/rn >o ߏTyaO=8jy,Ŀ^?rȪ.(ɲmQ?KAuJ#^tض)XJP)0v.P2E`$zà _ Lʛ.׭h@4mwH7ᖦÝ-V{2)#_*B1q`4Y_,俬DP&Υ,d ž >CbXB20o!i3!.0nmu` THqQOqdsYB1L86{٧'Vm:$|ՀU<ÃɸE{0"78(&ԀPV kPUfsvͯrԩRӇP\-눔A*] p)UT_<Ş'I2q>jVvWO}n纜U0ɢAl{(j4'I E&+A۪<3BTwڣ*Yp4Nܞi1E\ ^aOAY-?0Q#ZU0 :s]!I %=xHIwPLTf7hiԙ/^+b!4)lKLG}(іTtQֽJ_;I+ᦺ* 9,"/A=?Ur !W/2#oYdiJ9ߢ7@z[r&]t0uߊ+.F?msJ. xՑܮ:Q+1dmK\#mA x62氆 CΞZ,Tݼ+|}!F1P]GS'V ,ETRqIG%r~DKeyZSA, jU$9? ,~׾o9Z9h[_))qQ<+l"$%׼-j \n!C1O{y.Kf\yd ,V9xshrl event loop. */ public function tick(): void { // Add any delayed handles if needed. if ($this->delays) { $currentTime = Utils::currentTime(); foreach ($this->delays as $id => $delay) { if ($currentTime >= $delay) { unset($this->delays[$id]); \curl_multi_add_handle( $this->_mh, $this->handles[$id]['easy']->handle ); } } } // Step through the task queue which may add additional requests. P\Utils::queue()->run(); if ($this->active && \curl_multi_select($this->_mh, $this->selectTimeout) === -1) { // Perform a usleep if a select returns -1. // See: https://bugs.php.net/bug.php?id=61141 \usleep(250); } while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) { } $this->processMessages(); } /** * Runs until all outstanding connections have completed. */ public function execute(): void { $queue = P\Utils::queue(); while ($this->handles || !$queue->isEmpty()) { // If there are no transfers, then sleep for the next delay if (!$this->active && $this->delays) { \usleep($this->timeToNext()); } $this->tick(); } } private function addRequest(array $entry): void { $easy = $entry['easy']; $id = (int) $easy->handle; $this->handles[$id] = $entry; if (empty($easy->options['delay'])) { \curl_multi_add_handle($this->_mh, $easy->handle); } else { $this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000); } } /** * Cancels a handle from sending and removes references to it. * * @param int $id Handle ID to cancel and remove. * * @return bool True on success, false on failure. */ private function cancel($id): bool { if (!is_int($id)) { trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an integer to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__); } // Cannot cancel if it has been processed. if (!isset($this->handles[$id])) { return false; } $handle = $this->handles[$id]['easy']->handle; unset($this->delays[$id], $this->handles[$id]); \curl_multi_remove_handle($this->_mh, $handle); \curl_close($handle); return true; } private function processMessages(): void { while ($done = \curl_multi_info_read($this->_mh)) { if ($done['msg'] !== \CURLMSG_DONE) { // if it's not done, then it would be premature to remove the handle. ref https://github.com/guzzle/guzzle/pull/2892#issuecomment-945150216 continue; } $id = (int) $done['handle']; \curl_multi_remove_handle($this->_mh, $done['handle']); if (!isset($this->handles[$id])) { // Probably was cancelled. continue; } $entry = $this->handles[$id]; unset($this->handles[$id], $this->delays[$id]); $entry['easy']->errno = $done['result']; $entry['deferred']->resolve( CurlFactory::finish($this, $entry['easy'], $this->factory) ); } } private function timeToNext(): int { $currentTime = Utils::currentTime(); $nextTime = \PHP_INT_MAX; foreach ($this->delays as $time) { if ($time < $nextTime) { $nextTime = $time; } } return ((int) \max(0, $nextTime - $currentTime)) * 1000000; } }