I would like to propose a feature that facilitates a smoother integration of the RoadRunner server within a distributed environment. This would cater to scenarios where multiple instances of RoadRunner servers are being run on remote servers dedicated to different functions like cache management, job queues, and metric gathering, among others.
Background
The RoadRunner server provides an RPC interface enabling communication between the server and PHP applications. This communication includes commands such as updating cache storage or sending metrics to a plugin. Here you can find more information about RPC https://roadrunner.dev/docs/php-rpc
However, when RoadRunner servers are distributed (running multiple server instances on remote servers), there arises a necessity to manage these servers' RPC connections effectively. This is to ensure that each command reaches the correct server instance based on its dedicated function.
Proposal
Introducing a class like RoaRunnerConnectionManagerInterface which would allow a convenient way to manage these connections. The interface would receive a connection name and return the proper connection with the desired RoadRunner server.
Here’s a simplified outline of what the RoaRunnerConnectionManagerInterface interface could look like:
namespace Spiral\RoadRunnerBridge;
use Spiral\Goridge\RPC\RPCInterface;
interface RoaRunnerConnectionManagerInterface
{
public function connect(string $connection): RPCInterface;
}
Configuration
Connections can be configured in a config file, and each connection is represented by a name along with its server address.
I would like to propose a feature that facilitates a smoother integration of the RoadRunner server within a distributed environment. This would cater to scenarios where multiple instances of RoadRunner servers are being run on remote servers dedicated to different functions like cache management, job queues, and metric gathering, among others.
Background
The RoadRunner server provides an RPC interface enabling communication between the server and PHP applications. This communication includes commands such as updating cache storage or sending metrics to a plugin. Here you can find more information about RPC https://roadrunner.dev/docs/php-rpc
However, when RoadRunner servers are distributed (running multiple server instances on remote servers), there arises a necessity to manage these servers' RPC connections effectively. This is to ensure that each command reaches the correct server instance based on its dedicated function.
Proposal
Introducing a class like
RoaRunnerConnectionManagerInterface
which would allow a convenient way to manage these connections. The interface would receive a connection name and return the proper connection with the desired RoadRunner server.Here’s a simplified outline of what the
RoaRunnerConnectionManagerInterface
interface could look like:Configuration
Connections can be configured in a config file, and each connection is represented by a name along with its server address.
Usage Example
In the context of managing a queue, connections can be set within specific bridge integrations:
I am looking forward to feedback and further discussions regarding the feasibility and the potential integration of this feature.