SwooleServerEventBinder
in package
FinalYes
Tags
Table of Contents
Methods
- bindRequest() : void
- bindWebSocket() : void
- bindWorkerStop() : void
- recordFailureAndMaybeShutdown() : void
- Sliding-window failure counter — 3 failures within 5s triggers Server::shutdown(). Called by each runner from the WorkerStart catch block; the runner provides a mode-specific shutdown message.
Methods
bindRequest()
public
static bindRequest(Server|Server $server, ServerRuntime $runtime, LoggerInterface $logger) : void
Parameters
- $server : Server|Server
- $runtime : ServerRuntime
- $logger : LoggerInterface
bindWebSocket()
public
static bindWebSocket(Server $server, ServerRuntime $runtime, callable(Server, int, ServerRequestInterface): WebSocketContext $contextFactory, LoggerInterface $logger) : void
Parameters
- $server : Server
- $runtime : ServerRuntime
- $contextFactory : callable(Server, int, ServerRequestInterface): WebSocketContext
- $logger : LoggerInterface
bindWorkerStop()
public
static bindWorkerStop(Server|Server $server, ServerRuntime $runtime, Duration $shutdownTimeout, LoggerInterface $logger) : void
Parameters
- $server : Server|Server
- $runtime : ServerRuntime
- $shutdownTimeout : Duration
- $logger : LoggerInterface
recordFailureAndMaybeShutdown()
Sliding-window failure counter — 3 failures within 5s triggers Server::shutdown(). Called by each runner from the WorkerStart catch block; the runner provides a mode-specific shutdown message.
public
static recordFailureAndMaybeShutdown(Server|Server $server, ServerRuntime $runtime, LoggerInterface $logger, string $shutdownMessage) : void
Parameters
- $server : Server|Server
- $runtime : ServerRuntime
- $logger : LoggerInterface
- $shutdownMessage : string