PHPackages                             nyatmeat/roadrunner-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. nyatmeat/roadrunner-bundle

ActiveSymfony-bundle

nyatmeat/roadrunner-bundle
==========================

A RoadRunner worker as a Symfony Bundle

2.1.2(4y ago)023MITPHPPHP &gt;=7.4

Since Dec 10Pushed 4y agoCompare

[ Source](https://github.com/nyatMeat/roadrunner-bundle)[ Packagist](https://packagist.org/packages/nyatmeat/roadrunner-bundle)[ GitHub Sponsors](https://github.com/Baldinof)[ RSS](/packages/nyatmeat-roadrunner-bundle/feed)WikiDiscussions 2.x Synced 4w ago

READMEChangelog (1)Dependencies (27)Versions (27)Used By (0)

Roadrunner Bundle
=================

[](#roadrunner-bundle)

[RoadRunner](https://roadrunner.dev/) is a high-performance PHP application server, load-balancer, and process manager written in Golang.

This bundle provides a RoadRunner Worker integrated in Symfony, it's easily configurable and extendable.

Installation
------------

[](#installation)

Run the following command:

```
composer require baldinof/roadrunner-bundle

```

If you don't use Symfony Flex:

- register `Baldinof\RoadRunnerBundle\BaldinofRoadRunnerBundle` in your kernel
- copy default RoadRunner configuration files: `cp vendor/baldinof/roadrunner-bundle/.rr.* .`

Usage
-----

[](#usage)

- get the RoadRunner binary: `vendor/bin/rr get --location bin/`
- run RoadRunner with `bin/rr serve` or `bin/rr serve -c .rr.dev.yaml` (watch mode)
- visit your app at

Integrations
------------

[](#integrations)

Depending on installed bundle &amp; your configuration, this bundles add some integrations:

- **Sentry**: configure the request context (if the [`SentryBundle`](https://github.com/getsentry/sentry-symfony) is installed)
- **Sessions**: add the session cookie to the Symfony response (if `framework.sessions.enabled` config is `true`)
- **Doctrine Mongo Bundle**: clear opened managers after each requests (if [`DoctrineMongoDBBundle`](https://github.com/doctrine/DoctrineMongoDBBundle) is installed)
- **Doctrine ORM Bundle**: clear opened managers and check connection is still usable after each requests (if [`DoctrineBundle`](https://github.com/doctrine/DoctrineBundle) is installed)
- **Blackfire**: enable the probe when a profile is requested (if the [`blackfire`](https://blackfire.io/) extension is installed)

Even if it is not recommended, you can disable default integrations:

```
baldinof_road_runner:
  default_integrations: false
```

Middlewares
-----------

[](#middlewares)

You can use middlewares to manipulate request &amp; responses. Middlewares must implements [`Baldinof\RoadRunnerBundle\Http\MiddlewareInterface`](./src/Http/MiddlewareInterface.php).

Example configuration:

```
baldinof_road_runner:
    middlewares:
        - App\Middleware\YourMiddleware
```

Be aware that

- middlewares are run outside of Symfony `Kernel::handle()`
- the middleware stack is always resolved at worker start (can be a performance issue if your middleware initialization takes time)

Kernel reboots
--------------

[](#kernel-reboots)

The Symfony kernel and the dependency injection container are **preserved between requests**. If an exception is thrown during the request handling, the kernel is rebooted and a fresh container is used.

The goal is to prevent services to be in a non-recoverable state after an error.

To optimize your worker you can allow exceptions that does not put your app in an errored state:

```
# config/packages/baldinof_road_runner.yaml
baldinof_road_runner:
    kernel_reboot:
      strategy: on_exception
      allowed_exceptions:
        - Symfony\Component\HttpKernel\Exception\HttpExceptionInterface
        - Symfony\Component\Serializer\Exception\ExceptionInterface
        - App\Exception\YourDomainException
```

> If some of your services are stateful, you can implement `Symfony\Contracts\Service\ResetInterface` and your service will be resetted on each request.

If you are seeing issues and want to use a fresh container on each request you can use the `always` reboot strategy:

```
# config/packages/baldinof_road_runner.yaml
baldinof_road_runner:
    kernel_reboot:
      strategy: always
```

Events
------

[](#events)

The following events are dispatched throughout the worker lifecycle:

- `Baldinof\RoadRunnerBundle\Event\WorkerStartEvent`: Dispatched right before the worker starts listening to requests.
- `Baldinof\RoadRunnerBundle\Event\WorkerStopEvent`: Dispatched right before the worker closes.
- `Baldinof\RoadRunnerBundle\Event\WorkerExceptionEvent`: Dispatched after encountering an uncaught exception during request handling.
- `Baldinof\RoadRunnerBundle\Event\WorkerKernelRebootedEvent`: Dispatched after the symfony kernel was rebooted (see Kernel reboots).

Development mode
----------------

[](#development-mode)

Copy the dev config file if it's not present: `cp vendor/baldinof/roadrunner-bundle/.rr.dev.yaml .`

Start RoadRunner with the dev config file:

```
bin/rr serve -c .rr.dev.yaml

```

Reference:

If you use the Symfony VarDumper, dumps will not be shown in the HTTP Response body. You can view dumps with `bin/console server:dump` or in the profiler.

Metrics
-------

[](#metrics)

Roadrunner can [collect application metrics](https://roadrunner.dev/docs/beep-beep-metrics), and expose a prometheus endpoint.

Example configuration:

```
# config/packages/baldinof_road_runner.yaml
baldinof_road_runner:
  metrics:
    enabled: true
    collect:
      user_login:
        type: counter
        help: "Number of logged in user"
```

And configure RoadRunner:

```
# .rr.yaml
rpc:
  listen: "tcp:127.0.0.1:6001"

metrics:
  address: "0.0.0.0:9180" # prometheus endpoint
```

Then simply inject `Spiral\RoadRunner\MetricsInterface` to record metrics:

```
class YouController
{
    public function index(MetricsInterface $metrics): Response
    {
        $metrics->add('user_login', 1);

        return new Response("...");
    }
}
```

Usage with Docker
-----------------

[](#usage-with-docker)

```
# Dockerfile
FROM php:7.4-alpine

RUN apk add --no-cache autoconf openssl-dev g++ make pcre-dev icu-dev zlib-dev libzip-dev && \
    docker-php-ext-install bcmath intl opcache zip sockets && \
    apk del --purge autoconf g++ make

WORKDIR /usr/src/app

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

COPY composer.json composer.lock ./

RUN composer install --no-dev --no-scripts --no-plugins --prefer-dist --no-progress --no-interaction

RUN ./vendor/bin/rr get-binary --location /usr/local/bin

COPY . .

ENV APP_ENV=prod

RUN composer dump-autoload --optimize && \
    composer check-platform-reqs && \
    php bin/console cache:warmup

EXPOSE 8080

CMD ["rr", "serve"]
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Recently: every ~47 days

Total

26

Last Release

1622d ago

Major Versions

0.1 → 1.0.02020-02-13

1.x-dev → 2.0.0-BETA2021-04-06

PHP version history (3 changes)0.1PHP ^7.3

1.3.0PHP &gt;=7.3

2.0.0-BETAPHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c1546bef77dcc1cd0fadfc28a95221c1f1deaf0d133d5b4b126cd088c49540f?d=identicon)[nyatMeat](/maintainers/nyatMeat)

---

Top Contributors

[![Baldinof](https://avatars.githubusercontent.com/u/1597384?v=4)](https://github.com/Baldinof "Baldinof (105 commits)")[![hugochinchilla](https://avatars.githubusercontent.com/u/196416?v=4)](https://github.com/hugochinchilla "hugochinchilla (14 commits)")[![vsychov](https://avatars.githubusercontent.com/u/2186303?v=4)](https://github.com/vsychov "vsychov (11 commits)")[![nyatMeat](https://avatars.githubusercontent.com/u/26892345?v=4)](https://github.com/nyatMeat "nyatMeat (2 commits)")[![Punk-UnDeaD](https://avatars.githubusercontent.com/u/612391?v=4)](https://github.com/Punk-UnDeaD "Punk-UnDeaD (1 commits)")[![SlytherinCz](https://avatars.githubusercontent.com/u/6987470?v=4)](https://github.com/SlytherinCz "SlytherinCz (1 commits)")[![friedrichroell](https://avatars.githubusercontent.com/u/8887654?v=4)](https://github.com/friedrichroell "friedrichroell (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nyatmeat-roadrunner-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/nyatmeat-roadrunner-bundle/health.svg)](https://phpackages.com/packages/nyatmeat-roadrunner-bundle)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M648](/packages/sylius-sylius)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M192](/packages/simplesamlphp-simplesamlphp)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
