| @@ -1,9 +1,13 @@ |
| 1 | # The Handler drives the Runtime lifecycle instead of autoload_runtime.php | 1 | # The Handler drives the Runtime lifecycle instead of autoload_runtime.php |
| 2 | | 2 | |
| 3 | Scaleway owns the PHP process and calls a global `handle($event, $context)` for each Invocation, while the generated `vendor/autoload_runtime.php` re-includes `$_SERVER['SCRIPT_FILENAME']` and ends with `exit()`. | 3 | Scaleway owns the PHP process and calls a global `handle($event, $context)` for each Invocation, while the generated `vendor/autoload_runtime.php` re-includes `$_SERVER['SCRIPT_FILENAME']` and ends with `exit()`. |
| 4 | -We therefore ship a Handler that instantiates our `RuntimeInterface` itself, resolves the unchanged Front Controller, and delegates each Invocation to the runner, keeping the `RuntimeInterface`/`RunnerInterface` contract and the `extra.runtime` options. | 4 | +We therefore ship a Handler that instantiates our `RuntimeInterface` itself, resolves the unchanged Front Controller through its resolver, and delegates each Invocation to a runner, keeping the `RuntimeInterface` contract and the `extra.runtime` options. |
| | 5 | + |
| | 6 | +`RunnerInterface::run(): int` has no room for an Event nor a Function Response, so our runners implement an own `InvocationRunner::invoke($event, $context): array` instead. |
| | 7 | +`extra.runtime.class` and `APP_RUNTIME` are ignored: the Handler always uses `ScalewayRuntime`, as those name the runtime the same app uses elsewhere (FPM, FrankenPHP). |
| 5 | | 8 | |
| 6 | ## Considered Options | 9 | ## Considered Options |
| 7 | | 10 | |
| 8 | - Custom `autoload_template` without `exit`: rejected, still coupled to `SCRIPT_FILENAME`, which Scaleway controls. | 11 | - Custom `autoload_template` without `exit`: rejected, still coupled to `SCRIPT_FILENAME`, which Scaleway controls. |
| 9 | - Booting the Kernel by hand without the Runtime component: rejected, loses Front Controller portability and runtime options. | 12 | - Booting the Kernel by hand without the Runtime component: rejected, loses Front Controller portability and runtime options. |
| | 13 | +- A `RunnerInterface` built per Invocation around the Event: rejected, `getRunner()` only receives the Application, so the Event would travel through hidden mutable state on the runtime. |