Answer the question
In order to leave comments, you need to log in
Why can't I run the php artisan + workerman command?
Good evening everyone! But for me, he is not good at all!
I have a console command on the lara, and here is the handle:
public function handle()
{
$ws_worker = new Worker("websocket://...:8080");
$ws_worker->count = 4;
$this->clients = new \SplObjectStorage();
$ws_worker->onWorkerStart = function ($ws_worker) {};
$ws_worker->onConnect = function ($connection) {};
$ws_worker->onMessage = function ($connection, $data_request) {};
$ws_worker->onClose = function ($connection) {};
Worker::runAll();
}
public function handle()
{
global $argv;
$argv[1] = 'start';
$ws_worker = new Worker("websocket://...:8080");
$ws_worker->count = 4;
$this->clients = new \SplObjectStorage();
$ws_worker->onWorkerStart = function ($ws_worker) {};
$ws_worker->onConnect = function ($connection) {};
$ws_worker->onMessage = function ($connection, $data_request) {};
$ws_worker->onClose = function ($connection) {};
Worker::runAll();
}
Answer the question
In order to leave comments, you need to log in
Everything is done right! Just needed to set $ws_worker->count = 1.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question