Migration from RRv1 to RRv2
To migrate integration from RoadRunner v1.* to v2.*/v2023+, follow these steps.
Update Configuration
The second version of RoadRunner uses a single worker factory for all of its plugins. This means that you must include a new server section in your config, which is responsible for worker creation. The limit service is no longer presented as a separate entity but rather as part of specific service configuration.
rpc:
listen: tcp://127.0.0.1:6001
server:
command: "php tests/psr-worker-bench.php"
http:
address: "0.0.0.0:8080"
pool:
num_workers: 4Read more in the config reference.
No longer worry about echoing
RoadRunner 2.0+ intercepts all output to STDOUT. This means you can start using default var_dump and other echo functions without breaking the communication. Yay!
Explicitly declare PSR-15 dependency
We no longer ship a default PSR implementation with RoadRunner; make sure to include one you like the most yourself. For example:
Update Worker Code
RoadRunner simplifies worker creation: use the static create() method to automatically configure your worker:
Pass the PSR-15 factories to your PSR worker:
RoadRunner 2 unifies all workers to use similar naming: change acceptRequest to waitRequest:
Update RPCs
To create an RPC client, use the new Goridge API:
Last updated
Was this helpful?