<?phpuse Workerman\Worker;use Workerman\Lib\Timer; require_once ‘../../web/Workerman/Autoloader.php‘;require_once ‘../../web/Channel/src/Client.php‘; $worker = new Worker(‘http://0.0.0.0:8989‘);$worker->count = 4;$worker->reloadable = false; //平滑重启$worker->onWorkerStart = function ($worker){ if ($worker->id == 0) { Timer::add(1, function(){ require ‘./time.php‘; //平滑重启只会对on回调函数的require的业务代码生效 执行命令php xmpp.php reload echo $a; }); }}; Worker::runAll();
时间: 2024-10-27 09:44:38