Server
class Server implements OnRequestInterface, BootstrapsForServer
Properties
| protected Kernel|null | $kernel | ||
| protected string|null | $serverName | ||
| protected Dispatcher|null | $event | ||
| protected bool | $workerStarted | Whether this worker has observed the completed worker-start boundary. |
Methods
Resolve the Kernel, bootstrap the application if needed, and compile the routes.
Handle an incoming Swoole HTTP request.
Get the server name.
Set the server name.
Details
at line 42
__construct(Container $container)
No description
at line 57
void
bootstrapForServer(string $serverName)
Resolve the Kernel, bootstrap the application if needed, and compile the routes.
Called by the server boot process (Server\Server::registerSwooleEvents), before $server->start(). In SWOOLE_PROCESS mode this runs in the main process — workers inherit the compiled state via copy-on-write fork.
at line 79
void
onRequest(Request $swooleRequest, Response $swooleResponse)
Handle an incoming Swoole HTTP request.
Transport only: Swoole → Bridge → Kernel → Bridge → Swoole. Also dispatches request lifecycle events when listeners are registered.
at line 253
string
getServerName()
Get the server name.
at line 267
Server
setServerName(string $serverName)
Set the server name.
Mutates the worker-lifetime request handler before Swoole starts; runtime use races across requests and changes emitted server context.