@@ -21,6 +21,7 @@ class StartRoadRunnerCommand extends Command implements SignalableCommandInterfa
2121 public $ signature = 'octane:roadrunner
2222 {--host=127.0.0.1 : The IP address the server should bind to}
2323 {--port=8000 : The port the server should be available on}
24+ {--rpc-port= : The RPC port the server should be available on}
2425 {--workers=auto : The number of workers that should be available to handle requests}
2526 {--max-requests=500 : The number of requests to process before reloading the server}
2627 {--watch : Automatically reload the server when the application is modified} ' ;
@@ -73,6 +74,7 @@ public function handle(ServerProcessInspector $inspector, ServerStateFile $serve
7374 '-o ' , 'server.command= ' .(new PhpExecutableFinder )->find ().' ./vendor/bin/roadrunner-worker ' ,
7475 '-o ' , 'http.pool.num_workers= ' .$ this ->workerCount (),
7576 '-o ' , 'http.pool.max_jobs= ' .$ this ->option ('max-requests ' ),
77+ '-o ' , 'rpc.listen=tcp:// ' .$ this ->option ('host ' ).': ' .$ this ->rpcPort (),
7678 '-o ' , 'http.pool.supervisor.exec_ttl= ' .$ this ->maxExecutionTime (),
7779 '-o ' , 'http.static.dir=public ' ,
7880 '-o ' , 'http.middleware=static ' ,
@@ -101,6 +103,7 @@ protected function writeServerStateFile(
101103 'appName ' => config ('app.name ' , 'Laravel ' ),
102104 'host ' => $ this ->option ('host ' ),
103105 'port ' => $ this ->option ('port ' ),
106+ 'rpcPort ' => $ this ->rpcPort (),
104107 'workers ' => $ this ->workerCount (),
105108 'maxRequests ' => $ this ->option ('max-requests ' ),
106109 'octaneConfig ' => config ('octane ' ),
@@ -129,6 +132,16 @@ protected function maxExecutionTime()
129132 return config ('octane.max_execution_time ' , '30 ' ).'s ' ;
130133 }
131134
135+ /**
136+ * Get the RPC port the server should be available on.
137+ *
138+ * @return int
139+ */
140+ protected function rpcPort ()
141+ {
142+ return $ this ->option ('rpc-port ' ) ?: $ this ->option ('port ' ) - 1999 ;
143+ }
144+
132145 /**
133146 * Write the server process output to the console.
134147 *
0 commit comments