Server
class Server implements ServerInterface
Properties
| protected Server|null | $server | ||
| protected array | $onRequestCallbacks | ||
| protected array<string, null|Closure> | $primaryResponseCallbacks |
Methods
No description
Start the server.
Get the underlying Swoole server instance.
Sort servers so websocket/http servers are initialized first.
Create the appropriate Swoole server instance based on type.
Register Swoole event callbacks on the server or port.
Guard a native response callback from escaping its transport boundary.
Guard an inter-worker delivery callback from escaping its transport boundary.
Report a callback failure without escaping the native boundary.
Get the default server callbacks for the bootstrap lifecycle.
Details
at line 38
__construct(Container $container, LoggerInterface $logger, Dispatcher $eventDispatcher)
No description
at line 48
ServerInterface
init(ServerConfig $config)
Initialize the server with the given configuration.
Mutates the underlying Swoole server and registered callbacks; runtime use races with active workers and request handling.
at line 59
void
start()
Start the server.
at line 75
Server
getServer()
Get the underlying Swoole server instance.
at line 86
protected void
initServers(ServerConfig $config)
Initialize all server ports from the configuration.
Mutates the underlying Swoole server and the process-wide server registry; runtime use races with active workers and request handling.
at line 146
protected array
sortServers(array $servers)
Sort servers so websocket/http servers are initialized first.
at line 174
protected Server
makeServer(int $type, string $host, int $port, int $mode, int $sockType)
Create the appropriate Swoole server instance based on type.
at line 191
protected void
registerSwooleEvents(Port|Server $server, array $events, string $serverName)
Register Swoole event callbacks on the server or port.
at line 275
protected Closure
guardResponseCallback(callable $callback, bool $secure)
Guard a native response callback from escaping its transport boundary.
at line 307
protected Closure
guardWorkerDeliveryCallback(callable $callback)
Guard an inter-worker delivery callback from escaping its transport boundary.
The source ID is the sending worker ID for pipe messages and the task ID for task results.
at line 322
protected void
reportCallbackFailure(Throwable $throwable)
Report a callback failure without escaping the native boundary.
at line 337
protected array
defaultCallbacks()
Get the default server callbacks for the bootstrap lifecycle.