PHPackages                             symfony-bundles/event-queue-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. [Caching](/categories/caching)
4. /
5. symfony-bundles/event-queue-bundle

ActiveSymfony-bundle[Caching](/categories/caching)

symfony-bundles/event-queue-bundle
==================================

Symfony EventQueue Bundle

v2.0.1(8y ago)2512.7k↓66.7%1MITPHPPHP &gt;=5.6

Since May 24Pushed 8y ago6 watchersCompare

[ Source](https://github.com/symfony-bundles/event-queue-bundle)[ Packagist](https://packagist.org/packages/symfony-bundles/event-queue-bundle)[ Docs](https://github.com/symfony-bundles/event-queue-bundle)[ RSS](/packages/symfony-bundles-event-queue-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)Dependencies (5)Versions (8)Used By (0)

SymfonyBundlesEventQueueBundle
==============================

[](#symfonybundleseventqueuebundle)

[![SensioLabsInsight](https://camo.githubusercontent.com/0e2ed5cf01aab9cb7d55994dc6d6f4276424c8d26fa65c9c2ccba3ab01388236/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f36393661346230322d386434632d343563612d393234632d6336316638663036656439652f6269672e706e67)](https://insight.sensiolabs.com/projects/696a4b02-8d4c-45ca-924c-c61f8f06ed9e)

[![Build Status](https://camo.githubusercontent.com/b11f14e9279aa857bbff5846135dee2b50b314aed2204c670be856e26136f60f/68747470733a2f2f7472617669732d63692e6f72672f73796d666f6e792d62756e646c65732f6576656e742d71756575652d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/symfony-bundles/event-queue-bundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8381b7f5c745c985290fe2bccafc6138cc328fbe2438314be4372d70cf92160c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73796d666f6e792d62756e646c65732f6576656e742d71756575652d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/symfony-bundles/event-queue-bundle/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/04680485c3eea8a5964f9d85564ecb596e11174ee255b7483cbc4dd1a7eb335d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73796d666f6e792d62756e646c65732f6576656e742d71756575652d62756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/symfony-bundles/event-queue-bundle/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/cc6d12aec6e68d5cdc3baaa45270682650421f9f6fbebd99413b31fda599d675/68747470733a2f2f706f7365722e707567782e6f72672f73796d666f6e792d62756e646c65732f6576656e742d71756575652d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/symfony-bundles/event-queue-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/98be35e561c76a19106e31081f46bb90acf8c2852cab47a77f2f1c7e231f5b52/68747470733a2f2f706f7365722e707567782e6f72672f73796d666f6e792d62756e646c65732f6576656e742d71756575652d62756e646c652f762f737461626c65)](https://packagist.org/packages/symfony-bundles/event-queue-bundle)[![License](https://camo.githubusercontent.com/d1ed07d967fb32eb7db8154860255fc67cd248e9b3512a7e921dcf868cc7ba9a/68747470733a2f2f706f7365722e707567782e6f72672f73796d666f6e792d62756e646c65732f6576656e742d71756575652d62756e646c652f6c6963656e7365)](https://github.com/symfony-bundles/event-queue-bundle/blob/master/LICENSE)

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

[](#installation)

- Require the bundle with composer:

```
composer require symfony-bundles/event-queue-bundle
```

- Enable the bundle in the kernel:

```
public function registerBundles()
{
    $bundles = [
        // ...
        new SymfonyBundles\EventQueueBundle\SymfonyBundlesEventQueueBundle(),
        // ...
    ];
    ...
}
```

- Configure the EventQueue bundle in your config.yml.

Defaults configuration:

```
sb_event_queue:
    service_name: 'event_queue'
    default_name: 'event:default'
    storage_path: '%kernel.cache_dir%/event-queue-daemon.%s.pid'
```

- Configure the redis client in your config.yml. Read more about [RedisBundle configuration](https://github.com/symfony-bundles/redis-bundle#installation).

How to use
----------

[](#how-to-use)

Add an event to the queue:

```
$dispatcher = $this->get('sb_event_queue');

$dispatcher->on(MyEvent::class, date('Y-m-d H:i:s'), 'Example message');
```

Your event class must implement `SymfonyBundles\EventQueueBundle\EventInterface`(or extending `SymfonyBundles\EventQueueBundle\Event` class) and having constant `NAME` with the event name. For example:

```
namespace AppBundle\Event;

use SymfonyBundles\EventQueueBundle\Event;

class MyEvent extends Event
{
    const NAME = 'event.example';

    private $time;
    private $message;

    public function __construct($time, $message)
    {
        $this->time = $time;
        $this->message = $message;
    }

    public function getTime()
    {
        return $this->time;
    }

    public function getMessage()
    {
        return $this->message;
    }
}
```

Creating an Event Listener. The most common way to listen to an event is to register an event listener:

```
namespace AppBundle\EventListener;

use AppBundle\Event\MyEvent;

class MyListener
{
    public function onEventExample(MyEvent $event)
    {
        $event->getTime();
        $event->getMessage();

        // and we are doing something...
    }
}
```

Now that the class is created, you just need to register it as a service and notify Symfony that it is a "listener":

```
services:
    app.my_listener:
        class: AppBundle\EventListener\MyListener
        tags:
            - { name: kernel.event_listener, event: event.example }
```

Execution (dispatching) of all events from the queue:

```
while ($dispatcher->count()) {
    $dispatcher->dispatch();
}
```

You can separate the events by section, specifying in event manager the needed section.

```
$dispatcher->setName('email.notifications');

$dispatcher->on(EmailNotifyEvent::class, 'Subject', 'Message Body', ['john@domain.com', 'alex@domain.com']);
$dispatcher->on(EmailNotifyEvent::class, 'Another subject', 'Another message Body', ['demo@domain.com']);

$dispatcher->setName('database.reindex');

$dispatcher->on(DatabaseReindexEvent::class, 'users');
$dispatcher->on(DatabaseReindexEvent::class, 'orders');
$dispatcher->on(DatabaseReindexEvent::class, 'products');
```

In this example, will be executed only an events from the section `email.notifications`:

```
$dispatcher->setName('email.notifications');

while ($dispatcher->count()) {
    $dispatcher->dispatch();
}
```

Console commands:

- `event:queue:dispatch`
- `event:queue:daemon:start`
- `event:queue:daemon:stop`

In what situations is useful to apply the queue of events:

- When sending email messages
- Parsing websites
- and in other cases, when the execution time of process is very long, and the response from the server must be returned immediately.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~85 days

Recently: every ~126 days

Total

7

Last Release

3135d ago

Major Versions

v1.0.3 → v2.0.02016-06-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6610c7c63bc376406e4f75c07c5a0a4134fb72251d64e03ffeefe12a95f4ef1?d=identicon)[khaperets](/maintainers/khaperets)

---

Top Contributors

[![khaperets](https://avatars.githubusercontent.com/u/2507262?v=4)](https://github.com/khaperets "khaperets (36 commits)")

---

Tags

eventphpqueueredissymfonysymfony-bundleeventsymfonybundleredisqueuedispatcher

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/symfony-bundles-event-queue-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/symfony-bundles-event-queue-bundle/health.svg)](https://phpackages.com/packages/symfony-bundles-event-queue-bundle)
```

###  Alternatives

[symfony-bundles/queue-bundle

Symfony Queue Bundle

3219.4k1](/packages/symfony-bundles-queue-bundle)[resquebundle/resque

A Symfony 4 bundle to manage Resque job queues

51137.1k1](/packages/resquebundle-resque)[mjphaynes/php-resque

Redis backed library for creating background jobs and processing them later.

228199.3k2](/packages/mjphaynes-php-resque)[mmoreram/rsqueue-bundle

Redis Symfony2 Queue Bundle, a simple and soft redis based message queue for symfony2

5360.7k1](/packages/mmoreram-rsqueue-bundle)[symfony-bundles/redis-bundle

Symfony Redis Bundle

271.1M5](/packages/symfony-bundles-redis-bundle)[gos/pubsub-router-bundle

Symfony PubSub Router Bundle

442.2M1](/packages/gos-pubsub-router-bundle)

PHPackages © 2026

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