Skip to content

Create async version of curl_init_pooled #7725

Open
@eryi

Description

@eryi

HHVM Version

3.18.1

Standalone code, or other way to reproduce the problem

<?hh

\HH\curl_create_pool('mypool', 1, 100000);

$awaitables = array_map(async ($index) ==> {
  $curl = curl_init_pooled('mypool', "http://google.com");
  print "REQUESTING $index\n";
  await HH\Asio\curl_exec($curl);
  print "FINISHED $index\n";
}, range(1,5));

\HH\Asio\join(\HH\Asio\v($awaitables));

Expected result

REQUESTING 1
FINISHED 1
REQUESTING 2
FINISHED 2
REQUESTING 3
FINISHED 3
REQUESTING 4
FINISHED 4
REQUESTING 5
FINISHED 5

Actual result

REQUESTING 1
(wait for 100000 ms here)
FINISHED 1

Fatal error: Uncaught exception 'RuntimeException' with message 'Timeout reached waiting for an available pooled curl connection!'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions