Homec4science

Use cURL multi interface in HTTPSFuture

Authored by epriestley <git@epriestley.com> on Feb 6 2013, 05:12.

Description

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

Details

Committed
epriestley <git@epriestley.com>Feb 6 2013, 05:12
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUd1644c2768d7: Allow specifying precission in PhutilNumber
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUcb3e15803a03: Use cURL multi interface in HTTPSFuture (authored by epriestley <git@epriestley.com>).Feb 6 2013, 05:12