I have a laravel application in which run I'm running a command line task.
The task basically fetches data from the database and writes it to disk. The files are about 15-35kb in size. There are about 30 to 60 files being written for each task. Currently I'm testing running just one task.
public function run(){
// ...code....
$awaitables = [];
foreach ($sites as $site){
try {
$awaitables[] = $this->process($site);
} catch(\Exception $e){
\Log::exception($e);
}
}
$asyncCalls = \HH\Asio\v($awaitables);
echo "Im here". PHP_EOL;
$returns = \HH\Asio\join($asyncCalls);
var_dump($returns);
}
When I run the task
time hhvm -v Eval.Jit=0 artisan exportfiles
The time output shows around 2 minutes. However the files are created rather quickly within about 20 seconds or so. I'm wondering why is there a 1 minute hang after I see the dump of the $returns variable.
I thought HH\Asio\Join($awaitables);
concludes the asynchronous processes.
HipHop VM 3.18.0-dev (rel)
Compiler: heads/master-0-g0f6803df27b27f929f5edc175e11d302643f3a2c
Repo schema: 1733dfccb8791a77b6ce7b894ddd66e3238c2106
set_mempolicy: Operation not permitted
Running MacBook Pro 16gb Sierra Using Docker For Mac