RoadRunner
API reference › RoadRunner › RoadRunner
Runs the RoadRunner request loop for a Yii PSR bridge application.
See also: Application (for the PSR bridge application implementation.).
Methods
Section titled “Methods”| Method | Description | Defined 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 |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(yii2\extensions\psrbridge\http\Application $app)Creates a new instance of the RoadRunner class.
Parameters
| Parameter | Type | Description |
|---|---|---|
$app | yii2\ | PSR bridge application instance. |
run()
Section titled “run() ”public function run(): intProcesses 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.