2023-11-17 01:44:01 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once __DIR__ . '/vendor/autoload.php';
|
|
|
|
|
|
|
|
use Adapterman\Adapterman;
|
|
|
|
use Workerman\Worker;
|
|
|
|
Adapterman::init();
|
|
|
|
|
|
|
|
$http_worker = new Worker('http://127.0.0.1:7010');
|
2024-04-09 10:52:10 -04:00
|
|
|
$http_worker->count = getenv('WEBMAN_WORKERS') ?: (swoole_cpu_num() ?: 1);
|
2023-11-17 01:44:01 -05:00
|
|
|
$http_worker->name = 'AdapterMan';
|
|
|
|
|
|
|
|
$http_worker->onWorkerStart = static function () {
|
|
|
|
//init();
|
2024-04-07 10:23:34 -04:00
|
|
|
require __DIR__ . '/start.php';
|
2023-11-17 01:44:01 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
$http_worker->onMessage = static function ($connection, $request) {
|
|
|
|
|
|
|
|
$connection->send(run());
|
|
|
|
};
|
|
|
|
|
|
|
|
Worker::runAll();
|