Skip to content

SwooleServerInterface

The slice of \Swoole\Http\Server the runtime drives, so the loop’s wiring can be asserted without ext-swoole (and without actually binding a port).

interface SwooleServerInterface

Implemented byNativeSwooleServer
SourceSwooleServerInterface.php
MethodDescription
onRequest(callable(\Swoole\Http\Request, \Swoole\Http\Response): void $listener): void
onWorkerStart(callable(): void $listener): voidRuns once in each freshly forked worker child, before it takes a request.
start(): voidBinds and serves; does not return until the server stops.

abstract public function onRequest(callable(\Swoole\Http\Request, \Swoole\Http\Response): void $listener): void

ParameterTypeDescription
$listenercallable(\Swoole\Http\Request, \Swoole\Http\Response): void

abstract public function onWorkerStart(callable(): void $listener): void

Runs once in each freshly forked worker child, before it takes a request.

ParameterTypeDescription
$listenercallable(): void

abstract public function start(): void

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