Skip to content

Conversation

@butschster
Copy link
Contributor

@butschster butschster commented Oct 10, 2023

see #1728

Q A
Bugfix?
Breaks BC?
New feature? ✔️
Issues roadrunner-server/roadrunner#1728

With this new feature, developers can now scale their RoadRunner workers dynamically via RPC. We've added a Spiral\RoadRunner\WorkerPool class that provides an easy interface to add or remove workers from the RoadRunner worker pool, specifically for plugins that run in a worker mode.

Usage

Here's a quick example of how to use the 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 worker to the pool.
$pool->addWorker('http');

// Remove worker from the pool.
$pool->removeWorker('http');

This provides developers more control and flexibility over their RoadRunner setup, allowing for better resource allocation based on the needs of their application.

@butschster butschster added the enhancement New feature or request label Oct 10, 2023
@butschster butschster self-assigned this Oct 10, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (5c22fab) 29.85% compared to head (23e2811) 48.37%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@              Coverage Diff              @@
##                3.x      #31       +/-   ##
=============================================
+ Coverage     29.85%   48.37%   +18.51%     
- Complexity       91       94        +3     
=============================================
  Files             9        9               
  Lines           211      215        +4     
=============================================
+ Hits             63      104       +41     
+ Misses          148      111       -37     
Files Coverage Δ
src/WorkerPool.php 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@butschster butschster merged commit 88104bf into 3.x Oct 10, 2023
@butschster butschster deleted the feature/1728 branch October 10, 2023 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants