count = (int) shell_exec('nproc') * 4; $http_worker->name = 'AdapterMan-Leaf'; $http_worker->onWorkerStart = static function () { HeaderDate::init(); //init(); require __DIR__.'/index.php'; }; $http_worker->onMessage = static function ($connection) { $_SERVER['SCRIPT_NAME'] = 'index.php'; $connection->send(run()); }; Worker::runAll(); class HeaderDate { const NAME = 'Date: '; /** * Date header * * @var string */ public static $date; public static function init(): void { self::$date = self::NAME . gmdate('D, d M Y H:i:s').' GMT'; Timer::add(1, static function() { self::$date = self::NAME . gmdate('D, d M Y H:i:s').' GMT'; }); } }