NativeSwooleServer
Pure delegation onto the real Swoole server.
Synopsis
Section titled “Synopsis”final class NativeSwooleServer implements SwooleServerInterface
| Implements | SwooleServerInterface |
| Source | NativeSwooleServer.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(Server $server): mixed
| Parameter | Type | Description |
|---|---|---|
$server | Server |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
onRequest(callable $listener): void | Registers the listener on Swoole’s request event, arguments unchanged. |
onWorkerStart(callable(): void $listener): void | Registers on Swoole’s workerStart event, dropping the server and worker id arguments Swoole passes so the listener stays free of extension types. |
start(): void | Binds and serves; does not return until the server stops. |
onRequest()
Section titled “onRequest()”public function onRequest(callable $listener): void
Registers the listener on Swoole’s request event, arguments unchanged.
| Parameter | Type | Description |
|---|---|---|
$listener | callable |
onWorkerStart()
Section titled “onWorkerStart()”public function onWorkerStart(callable(): void $listener): void
Registers on Swoole’s workerStart event, dropping the server and worker id arguments Swoole passes so the listener stays free of extension types.
| Parameter | Type | Description |
|---|---|---|
$listener | callable(): void |
start()
Section titled “start()”public function start(): void
Binds and serves; does not return until the server stops.