count = getenv('WEBMAN_WORKERS') ?: max(swoole_cpu_num(), 2); $http_worker->name = 'AdapterMan'; $http_worker->onWorkerStart = static function () { //init(); require __DIR__ . '/start.php'; }; $http_worker->onMessage = static function ($connection, $request) { static $request_count; $connection->send(run()); if (++$request_count > 10000) { Worker::stopAll(); } }; Worker::runAll();