Skip to content
PHP Ecosystem
Explore

RoadRunner

API reference › RoadRunner › RoadRunner

final classyii2\extensions\roadrunner\RoadRunner
Sourcesrc/RoadRunner.php

Runs the RoadRunner request loop for a Yii PSR bridge application.

See also: Application (for the PSR bridge application implementation.).

MethodDescriptionDefined by
__construct()Creates a new instance of the RoadRunner class.RoadRunner
run()Processes requests from the configured Application instance until the worker returns null.RoadRunner
public function __construct(yii2\extensions\psrbridge\http\Application $app)

Creates a new instance of the RoadRunner class.

Parameters

ParameterTypeDescription
$appyii2\extensions\psrbridge\http\ApplicationPSR bridge application instance.
public function run(): int

Processes requests from the configured Application instance until the worker returns null.

Reports failures through error() only while the response has not been emitted. Finalization runs once in finally, passing false when processing or emission fails. Memory is checked after either outcome.

Recycling declines the next dispatch before handling it, allowing RoadRunner to retry it in a fresh worker. Streaming read and finalization failures propagate after this handshake without a second request outcome; any transport failure during shutdown is retained as the previous exception. A further emission failure while closing an already-failed stream propagates immediately after finalization without another outcome.

Returns

int: Exit code indicating successful execution (ServerExitCode::OK).

Throws

  • Throwable: When streaming, worker transport, or application finalization fails.