Server
class Server implements ServerInterface
Properties
| protected Server|null | $server | ||
| protected array | $onRequestCallbacks |
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 34
__construct(Container $container, LoggerInterface $logger, Dispatcher $eventDispatcher)
No description
at line 44
ServerInterface
init(ServerConfig $config)
Initialize the server with the given configuration.
Boot-only. Mutates the underlying Swoole server and registered callbacks; runtime use races with active workers and request handling.
at line 54
void
start()
Start the server.
at line 67
Server
getServer()
Get the underlying Swoole server instance.
at line 75
protected void
initServers(ServerConfig $config)
Initialize all server ports from the configuration.
at line 127
protected array
sortServers(array $servers)
Sort servers so websocket/http servers are initialized first.
at line 155
protected Server
makeServer(int $type, string $host, int $port, int $mode, int $sockType)
Create the appropriate Swoole server instance based on type.
at line 172
protected void
registerSwooleEvents(Port|Server $server, array $events, string $serverName)
Register Swoole event callbacks on the server or port.
at line 221
protected Closure
guardResponseCallback(callable $callback)
Guard a native response callback from escaping its transport boundary.
at line 247
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 262
protected void
reportCallbackFailure(Throwable $throwable)
Report a callback failure without escaping the native boundary.
at line 277
protected array
defaultCallbacks()
Get the default server callbacks for the bootstrap lifecycle.