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, 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 39
__construct(Container $container)
No description
at line 54
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 76
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 213
string
getServerName()
Get the server name.
at line 227
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.