laravel-zeromq icon indicating copy to clipboard operation
laravel-zeromq copied to clipboard

Laravel-Lumen + ZeroMQ not receiving ANY events

Open typoworx-de opened this issue 4 years ago • 3 comments

I'm trying to use laravel-zeromq with bitcoind on laravel-lumen framework. Already installed composer-package and setup for config, ServiceProvider and Alias.

But after starting CLI-Command which should output some events, the script just silently loops through reactPHP loop-object and does nothing ...

My test code looks as follows:

        $loop = ZeroMQ()->connection('default')->subscribe(
            ['hashblock', 'hashtx'],
            function($blockhash, $sequence) {
                dd($blockhash);

                printf(
                    "New block %u found. Contains %u transactions.\n",
                    $block['height'],
                    $block->count('tx')
                );
            }
        );


        $loop->addPeriodicTimer(0.5, function () {
           echo "Still alive ...";
        });

        $loop->run();

The periodic-timer function is repeatingly executed. But there is no event received.

I already checked the culprid is nothing else. I've tested this nodejs-lib using example/sub.js and it works out of the box.

typoworx-de avatar Jun 12 '20 21:06 typoworx-de