Skip to content

Commit

Permalink
Use select() syscall to avoid busy waiting
Browse files Browse the repository at this point in the history
Currently it consumes a lot of CPU, it's a no-brainer i think.

Co-authored-by: Diego de Estrada
  • Loading branch information
jrfnl committed Oct 4, 2021
1 parent 6f6a690 commit 13f15af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Transport/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 13f15af

Please sign in to comment.