feat: add a woker mode (#1)

* refactor: better memory management

* wip

* tmp

* introduce a go-like api

* upgraded to PHP 8.2

* Fix thread safety issues

* fix tests

* wip

* refactor worker

* worker prototype

* fix populate env

* session

* improve tests

* fix Caddy tests

* refactor
This commit is contained in:
Kévin Dunglas
2022-05-18 11:52:24 +02:00
committed by GitHub
parent 0d1ff2c438
commit 7d81fa51fe
25 changed files with 1816 additions and 748 deletions

14
testdata/worker.php vendored Normal file
View File

@@ -0,0 +1,14 @@
<?php
$i = 0;
do {
$ok = frankenphp_handle_request(function () use ($i): void {
echo sprintf("Requests handled: %d (request time: %s)\n", $i, $_SERVER['REQUEST_TIME_FLOAT']);
var_export($_GET);
var_export($_POST);
var_export($_SERVER);
});
$i++;
} while ($ok);