| ▲ | martinald 2 hours ago | |
I feel like I'm on a different planet when I see this kind of comment. What if you need to call multiple external APIs at once with complex json? Sure you can call them one after another, but if each take (say) 2s to return (not uncommon IME), then you are in real trouble with only one thread - even if it is just for one "request". I guess I'm spoilt in .NET with Task.WhenAll which makes it trivial to do this kind of stuff. | ||
| ▲ | theodorejb an hour ago | parent [-] | |
This can be done with curl_multi_exec(), or with $client->getAsync() in Guzzle. https://www.php.net/manual/en/function.curl-multi-exec.php https://docs.guzzlephp.org/en/stable/quickstart.html#concurr... | ||