Server
class Server implements OnRequestInterface, BootstrapsForServer
Properties
| protected Kernel|null | $kernel | ||
| protected string|null | $serverName | ||
| protected Dispatcher|null | $event |
Methods
Resolve the Kernel, sync middleware to Router, and trigger route compilation.
Handle an incoming Swoole HTTP request.
Get the server name.
Set the server name.
Details
at line 33
__construct(Container $container)
No description
at line 48
void
bootstrapForServer(string $serverName)
Resolve the Kernel, sync middleware to Router, and trigger route compilation.
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 70
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 171
string
getServerName()
Get the server name.
at line 185
Server
setServerName(string $serverName)
Set the server name.
Boot-only. Mutates the worker-lifetime request handler before Swoole starts; runtime use races across requests and changes emitted server context.