From 13f15af55e37935ceafea421d1126fa4f5f1cade Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 18 Jun 2021 11:40:29 +0200 Subject: [PATCH] Use select() syscall to avoid busy waiting Currently it consumes a lot of CPU, it's a no-brainer i think. Co-authored-by: Diego de Estrada --- src/Transport/Curl.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Transport/Curl.php b/src/Transport/Curl.php index df98894a3..8e99092a1 100644 --- a/src/Transport/Curl.php +++ b/src/Transport/Curl.php @@ -245,6 +245,10 @@ public function request_multiple($requests, $options) { do { $active = 0; + if ($active) { + curl_multi_select($multihandle); + } + do { $status = curl_multi_exec($multihandle, $active); }