This feature became available starting from the RoadRunner 2023.3
release.
Users can now scale their RoadRunner workers dynamically via RPC.
A new class, Spiral\RoadRunner\WorkerPool
, has been introduced to provide an easy interface to add or remove
workers from the RoadRunner workers pool.
pool.debug=true
).Below is a brief example demonstrating how to use this new feature:
use Spiral\RoadRunner\WorkerPool;
use Spiral\Goridge\RPC\RPC;
$rpc = RPC::create('tcp://127.0.0.1:6001');
$pool = new WorkerPool($rpc);
// Add a worker to the pool.
$pool->addWorker('http');
// Remove a worker from the pool.
$pool->removeWorker('http');
http
, grpc
, temporal
, centrifuge
, tcp
, jobs
.This provides developers more control and flexibility over their RoadRunner setup, allowing for better resource allocation based on the needs of their application.