Use cURL multi interface in HTTPSFuture
Summary:
This violates the contract of isReady() which shouldn't block.
My implementation waits for any available handle.
The reason is that cURL doesn't expose the file descriptors for select: http://svn.php.net/viewvc/php/php-src/tags/php_5_4_0/ext/curl/multi.c?view=markup#l193
This will cause waiting for HTTPS future even if non-HTTPS future is already available.
I think that it is not a big deal.
Other solution is to rewrite FutureIterator to call Future-specific waiters instead of Future::waitForSockets().
Other solution is to remove curl_multi_select() and always busy wait.
Test Plan:
$futures = array(); for ($i=0; $i < 5; $i++) { $futures[] = new HTTPSFuture('http://www.vrana.cz/sleep.php'); } foreach (Futures($futures) as $future) { list(, $content) = $future->resolve(); echo "$content\n"; }
Please suggest me how to benchmark it (some Arcanist command?).
Reviewers: vrana, btrahan
Reviewed By: btrahan
CC: aran, Korvin, edward
Maniphest Tasks: T1683
Differential Revision: https://secure.phabricator.com/D2471