PHPackages                             fast-forward/event-dispatcher - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. fast-forward/event-dispatcher

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fast-forward/event-dispatcher
=============================

Fast-Forward PSR-14 Event Dispatcher is a simple and fast event dispatcher for PHP.

v1.0.0(yesterday)021↑2328.6%MITPHPPHP ^8.3CI passing

Since Apr 6Pushed todayCompare

[ Source](https://github.com/php-fast-forward/event-dispatcher)[ Packagist](https://packagist.org/packages/fast-forward/event-dispatcher)[ Docs](https://github.com/php-fast-forward)[ GitHub Sponsors](https://github.com/php-fast-forward)[ RSS](/packages/fast-forward-event-dispatcher/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (16)Versions (2)Used By (0)

Fast Forward Event Dispatcher
=============================

[](#fast-forward-event-dispatcher)

[![PHP Version](https://camo.githubusercontent.com/c9b19f1cbf8aefb8c278c8b5d392b64401164a08fced6ccbf376b32135d6714f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e332d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/releases/)[![Composer Package](https://camo.githubusercontent.com/55b7b8914e8e9c978b519c9dfb656246cd044760ddefc788d3d70fa933252be9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d666173742d2d666f72776172642532466576656e742d2d646973706174636865722d4632384431412e7376673f6c6f676f3d636f6d706f736572266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/fast-forward/event-dispatcher)[![PSR-14](https://camo.githubusercontent.com/aec8b34315f85d677eb088eb3ba4eca8b65de37965667a6253ae8bb48a07a058/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5053522d2d31342d6576656e742d2d646973706174636865722d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php-fig.org/psr/psr-14/)[![Tests](https://camo.githubusercontent.com/7f268ddc5c4d196cb2bd255ed3c83e5b472faac352ec3f6298818e27845d8c60/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7068702d666173742d666f72776172642f6576656e742d646973706174636865722f74657374732e796d6c3f6c6f676f3d676974687562616374696f6e73266c6f676f436f6c6f723d7768697465266c6162656c3d746573747326636f6c6f723d323243353545)](https://github.com/php-fast-forward/event-dispatcher/actions/workflows/tests.yml)[![Coverage](https://camo.githubusercontent.com/783041b70aa9cfca2a0969ddc49e11178a3367b14165ef787853fdc3075f43b3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d706870756e69742d3441444538303f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://php-fast-forward.github.io/event-dispatcher/coverage/index.html)[![Docs](https://camo.githubusercontent.com/02749eab9facc566520732b24e761233a9a8bb332a7a89b5929737bf401b6b93/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6465706c6f796d656e74732f7068702d666173742d666f72776172642f6576656e742d646973706174636865722f6769746875622d70616765733f6c6f676f3d72656164746865646f6373266c6f676f436f6c6f723d7768697465266c6162656c3d646f6373266c6162656c436f6c6f723d31453239334226636f6c6f723d333842444638267374796c653d666c6174)](https://php-fast-forward.github.io/event-dispatcher/index.html)[![License](https://camo.githubusercontent.com/1f21f24d4a334a0d9520a8fe16e302a0d8f8f59784abfc7c18ca2033c181a546/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7068702d666173742d666f72776172642f6576656e742d646973706174636865723f636f6c6f723d363437343842)](LICENSE)[![GitHub Sponsors](https://camo.githubusercontent.com/d61f432861a7c60e0a9620738dffd3b884bcf392c86e48a2cc87ea57a077e90a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73706f6e736f72732f7068702d666173742d666f72776172643f6c6f676f3d67697468756273706f6e736f7273266c6f676f436f6c6f723d776869746526636f6c6f723d454334383939)](https://github.com/sponsors/php-fast-forward)

A lightweight PSR-14 event dispatcher for PHP 8.3+ with named events, Symfony-style subscribers, attribute-based listeners, and first-class integration with the Fast Forward container.

✨ Features
----------

[](#-features)

- 🚀 PSR-14 dispatcher with support for `Symfony\Contracts\EventDispatcher\EventDispatcherInterface`
- 🏷️ Named events via `dispatch($event, $eventName)` and the `NamedEvent` wrapper
- 🔌 Automatic listener classification inside Fast Forward applications
- 🧩 Support for invokable listeners, Symfony subscribers, attributes, and custom listener providers
- 📊 Priority-aware execution for subscribers and `#[AsEventListener]`
- 🛑 Propagation control through `StoppableEventInterface`, the `Event` base class, and `StoppableEventTrait`
- 🧯 Error instrumentation through `ErrorEvent` and `LogErrorEventListener`
- 🌐 Wildcard listener providers for cross-cutting observers such as logging, metrics, and audit trails
- 🪶 Small surface area with practical defaults and clear extension points

📦 Installation
--------------

[](#-installation)

Install the package with Composer:

```
composer require fast-forward/event-dispatcher
```

Requirements:

- PHP `^8.3`
- `psr/event-dispatcher`
- `psr/container`
- `psr/log`
- `fast-forward/container`

If you want to register Symfony-style subscribers or use `#[AsEventListener]`, also install:

```
composer require symfony/event-dispatcher
```

🛠️ Usage
--------

[](#️-usage)

### 1. Dispatch a typed PSR-14 event

[](#1-dispatch-a-typed-psr-14-event)

The Fast Forward service provider wires the dispatcher and classifies configured listeners by strategy.

```
