smi2 / phpClickHouse

php ClickHouse wrapper
MIT License
750 stars 139 forks source link

selectAsync() does not work with Symfony console commands #143

Closed bun4uk closed 3 years ago

bun4uk commented 4 years ago

For some reason, select/executeAsync() don't work with Symfony commands. The script is just not responding. I tried to debug CurlerRolling::execLoopWait() methods and ($this->countActive() + $this->countPending()) is always bigger than 0; Probably it caused somehow by the buffered output of Symfony command. Have you ever faced this issue? Is there a way how to solve it?

isublimity commented 4 years ago

I haven't worked with Symfony, but you are the first to write about it. My colleagues who use symfony+async have never encountered such a problem.

Try a simple code like this, port to symfony :

for ($f=0;$f<1000;$f++)
{
    $list[$f]=$db->selectAsync('SELECT {num} as num',['num'=>$f]);
}
$db->executeAsync();
for ($f=0;$f<1000;$f++)
{
    $c=$list[$f];

    echo $f."\t";
    $ret='-';
    try{
        $ret=$c->fetchOne('num');
    }catch (Exception $e)
    {

    }

    echo "$ret\n";
}
isublimity commented 4 years ago

is always bigger than 0; - show some task not get/receive answer from CH