Ubuntu 20 (homestead)
PHP 7.4.14
Laravel 6.20.44
workerman/workerman 4.0.37
按照文档3、类方法作为回调 的第二种写法。
代码截图:
报错内容:
TypeError: Argument 1 passed to App\Services\WS\TestWS::onWorkerStop() must be an instance of Workerman\Connection\TcpConnection, instance of Workerman\Worker given, called in /vendor/workerman/workerman/Worker.php on line 2448 and defined in /app/Services/WS/TestWS.php:17
start 正常,ctrl+c 时会报错。
文档写错了,onWorkerStop($worker)传递的应该是当前的Worker实例
文档更新够快的,才不到10分钟,👍👍👍