# symfony/event-dispatcher

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/symfony-event-dispatcher).**

8,541 stars · 66 forks · PHP · MIT

## Links

- GitHub: https://github.com/symfony/event-dispatcher
- Homepage: https://symfony.com/event-dispatcher
- awesome-repositories: https://awesome-repositories.com/repository/symfony-event-dispatcher.md

## Topics

`component` `php` `symfony` `symfony-component`

## Description

Symfony Event Dispatcher is a library that implements the observer pattern, enabling event-driven communication between application components. It provides a central dispatch mechanism where components can broadcast named events and register listeners to react to them, decoupling event producers from consumers.

The library supports any PHP callable as an event listener and organizes listeners in a priority-ordered queue for controlled execution. Listeners can stop event propagation to prevent subsequent handlers from running, and the subscriber-based registration system allows grouping multiple event-to-listener mappings into reusable classes that self-register with the dispatcher.

Custom events can be dispatched with data payloads, and listeners can be attached to specific events with configurable priority. The system supports the event subscriber pattern for organizing multiple event handlers into single classes.

## Tags

### Software Engineering & Architecture

- [Event Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/event-dispatchers.md) — Provides an event-driven communication library that lets components broadcast named events and register listeners. ([source](https://symfony.com/doc/current/components/event_dispatcher.html))
- [Event Payload Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-event-dispatchers/reactive-event-dispatchers/event-payload-dispatchers.md) — Fires named events with data payloads from any part of an application to trigger registered listeners.
- [Event-Driven Architectures](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-architectures.md) — Implements event-driven architecture by decoupling components through a central dispatch mechanism.
- [Propagation Halting](https://awesome-repositories.com/f/software-engineering-architecture/event-propagation-patterns/propagation-halting.md) — Implements stoppable event propagation where listeners can halt further handler execution.
- [Event Subscribers](https://awesome-repositories.com/f/software-engineering-architecture/event-subscribers.md) — Provides an event subscriber pattern that groups multiple listeners into self-registering classes.
- [Listener Queues](https://awesome-repositories.com/f/software-engineering-architecture/queue-implementations/priority-queues/listener-queues.md) — Organizes event listeners in a priority-ordered queue for controlled execution order.

### User Interface & Experience

- [Event Propagation Halting](https://awesome-repositories.com/f/user-interface-experience/event-propagation-systems/event-propagation-halting.md) — Halts further listener execution for a dispatched event from within a listener. ([source](https://symfony.com/doc/current/components/event_dispatcher.html))
- [Callable Listeners](https://awesome-repositories.com/f/user-interface-experience/native-event-listeners/callable-listeners.md) — Provides a flexible listener interface that accepts any PHP callable as an event handler.

### Web Development

- [Application Event Listeners](https://awesome-repositories.com/f/web-development/application-event-listeners.md) — Broadcasts named events from application components and reacts to them via registered listeners. ([source](https://cdn.jsdelivr.net/gh/symfony/event-dispatcher@8.2/README.md))
- [Event Listener Managers](https://awesome-repositories.com/f/web-development/event-listener-managers.md) — Attaches callback functions to specific events with configurable execution priority for ordered responses.
- [Priority Listeners](https://awesome-repositories.com/f/web-development/event-listener-managers/priority-listeners.md) — Attaches callable listeners to named events with configurable priority and propagation control.
- [Event Listeners](https://awesome-repositories.com/f/web-development/event-listeners.md) — Attaches callable listeners to named events with optional priority ordering for execution. ([source](https://symfony.com/doc/current/components/event_dispatcher.html))
