onWorkerStart = function($worker) { $con = new AsyncTcpConnection('ws://127.0.0.1:8081'); //%action% $con->connect(); }; Worker::$pidFile = sprintf('%s/test-websocket-client.pid', sys_get_temp_dir()); Worker::$command = 'start'; Worker::runAll();