Skip to content

NativeSwooleServer

Pure delegation onto the real Swoole server.

final class NativeSwooleServer implements SwooleServerInterface

ImplementsSwooleServerInterface
SourceNativeSwooleServer.php

public function __construct(Server $server): mixed

ParameterTypeDescription
$serverServer

Returns mixed

MethodDescription
onRequest(callable $listener): voidRegisters the listener on Swoole’s request event, arguments unchanged.
onWorkerStart(callable(): void $listener): voidRegisters on Swoole’s workerStart event, dropping the server and worker id arguments Swoole passes so the listener stays free of extension types.
start(): voidBinds and serves; does not return until the server stops.

public function onRequest(callable $listener): void

Registers the listener on Swoole’s request event, arguments unchanged.

ParameterTypeDescription
$listenercallable

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.

ParameterTypeDescription
$listenercallable(): void

public function start(): void

Binds and serves; does not return until the server stops.