callback Worker::$onWorkerStart
设置Worker启动时的回调函数,即当Worker启动后立即执行Worker::onWorkerStart成员指定的回调函数
$worker
即Worker对象
use WorkermanWorker;
require_once __DIR__ . '/Workerman/Autoloader.php';
$worker = new Worker('websocket://0.0.0.0:8484');
$worker->onWorkerStart = function($worker)
{
echo "Worker starting...n";
};
// 运行worker
Worker::runAll();