Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 57 | All time: 10,569 This week: 39 |
Version | License | PHP version | Categories | |||
roadrunner 1.0 | MIT/X Consortium ... | 5 | Unix, Language, Performance and optim..., P... |
Description | Author | |||||||||||||||||||||||
This package can run multiple tasks of PHP in parallel using Golang. |
|
High-performance PHP load balancer and process manager library for Golang.
Library allows you to embed PHP code into Golang applications as managed pool of stateless workers.
$ go get github.com/spiral/roadrunner
$ composer require spiral/roadrunner
p, err := rr.NewPool(
func() *exec.Cmd { return exec.Command("php", "worker.php", "pipes") },
rr.NewPipeFactory(),
rr.Config{
NumWorkers: uint64(runtime.NumCPU()),
AllocateTimeout: time.Second,
DestroyTimeout: time.Second,
},
)
defer p.Destroy()
rsp, err := p.Exec(&Payload{Body: []byte("hello")})
<?php
/
* @var Goridge\RelayInterface $relay
*/
use Spiral\Goridge;
use Spiral\RoadRunner;
$rr = new RoadRunner\Worker($relay);
while ($body = $rr->receive($context)) {
try {
$rr->send((string)$body, (string)$context);
} catch (\Throwable $e) {
$rr->error((string)$e);
}
}
> Check how to init relay here. More examples can be found in tests.
The MIT License (MIT). Please see LICENSE
for more information.
Files (34) |
File | Role | Description | ||
---|---|---|---|---|
source (1 file, 1 directory) | ||||
tests (10 files) | ||||
.travis.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
config.go | Data | Auxiliary data | ||
config_test.go | Data | Auxiliary data | ||
factory.go | Data | Auxiliary data | ||
job_error.go | Data | Auxiliary data | ||
job_error_test.go | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
payload.go | Data | Auxiliary data | ||
pipe_factory.go | Data | Auxiliary data | ||
pipe_factory_test.go | Data | Auxiliary data | ||
pool.go | Data | Auxiliary data | ||
pool_test.go | Data | Auxiliary data | ||
protocol.go | Data | Auxiliary data | ||
protocol_test.go | Data | Auxiliary data | ||
README.md | Example | Example script | ||
socket_factory.go | Data | Auxiliary data | ||
socket_factory_test.go | Data | Auxiliary data | ||
state.go | Data | Auxiliary data | ||
state_test.go | Data | Auxiliary data | ||
worker.go | Data | Auxiliary data | ||
worker_test.go | Data | Auxiliary data |
Files (34) | / | tests |
File | Role | Description |
---|---|---|
broken.php | Example | Example script |
client.php | Example | Example script |
delay.php | Example | Example script |
echo.php | Example | Example script |
error.php | Example | Example script |
failboot.php | Example | Example script |
head.php | Example | Example script |
pid.php | Example | Example script |
slow-client.php | Example | Example script |
stop.php | Example | Example script |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.