# doctrine/event-manager

**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/doctrine-event-manager).**

6,047 stars · 22 forks · PHP · MIT

## Links

- GitHub: https://github.com/doctrine/event-manager
- Homepage: https://www.doctrine-project.org/projects/event-manager.html
- awesome-repositories: https://awesome-repositories.com/repository/doctrine-event-manager.md

## Topics

`event` `eventmanager`

## Description

Doctrine Event Manager is a PHP library that implements a publish-subscribe pattern for decoupled application communication. It provides a simple event bus that dispatches named events to registered listeners, enabling components to communicate without direct method calls and promoting loose coupling and extensibility in PHP projects.

The library manages listener callbacks in a central registry keyed by exact event name strings for fast lookup, and invokes listeners in priority sequence for controlled reaction order during event dispatch. It maintains no internal state between dispatches, relying solely on the listener registry for event handling, and invokes all listeners sequentially on the same thread for predictable and deterministic execution order.

Event names are treated independently without parent-child hierarchy or wildcard patterns, and event objects are created only at dispatch time to avoid memory allocation for unused events. The library is available as a standalone package installable via Composer.

## Tags

### Part of an Awesome List

- [Event Bus](https://awesome-repositories.com/f/awesome-lists/devtools/event-bus.md) — Ships a simple event bus for decoupling PHP components through event-driven communication.

### Networking & Communication

- [PHP Publish-Subscribe Systems](https://awesome-repositories.com/f/networking-communication/real-time-event-streams/publish-subscribe-event-systems/php-publish-subscribe-systems.md) — Implements a publish-subscribe pattern in PHP for decoupled event handling and listener management.

### Software Engineering & Architecture

- [Named Event Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-event-dispatchers/reactive-event-dispatchers/named-event-dispatchers.md) — Dispatches named events to registered listeners for decoupled application communication.
- [Stateless Event Buses](https://awesome-repositories.com/f/software-engineering-architecture/event-bus-architectures/stateless-event-buses.md) — Maintains no internal state between dispatches, relying solely on the listener registry for event handling.
- [Event Bus Priority Systems](https://awesome-repositories.com/f/software-engineering-architecture/event-bus-priority-systems.md) — Invokes listeners in priority sequence for controlled reaction order during event dispatch.
- [Event-Driven Architectures](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-architectures.md) — Implements an event-driven architecture where components communicate through events rather than direct method calls.
- [PHP](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-architectures/php.md) — Provides a PHP library for building applications where components communicate through events.
- [Event Handling](https://awesome-repositories.com/f/software-engineering-architecture/event-handling.md) — Provides synchronous, deterministic event listener invocation on a single thread.
- [Event Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/reactive-messaging/reactive-event-driven-systems/event-dispatchers.md) — Fires named events and notifies all registered listeners in order of priority.

### User Interface & Experience

- [PHP Event Dispatchers](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/interaction-and-event-handling/event-handling-architectures/input-event-dispatchers/application-event-dispatching/php-event-dispatchers.md) — Provides a PHP library that dispatches named events to registered listeners for decoupled communication.

### Web Development

- [Event Listener Managers](https://awesome-repositories.com/f/web-development/event-listener-managers.md) — Manages registration and notification of event listeners for named application events.
- [Priority Listeners](https://awesome-repositories.com/f/web-development/event-listener-managers/priority-listeners.md) — Manages listener callbacks in a central registry keyed by event name for fast lookup and priority-ordered execution.
- [Event Name Registries](https://awesome-repositories.com/f/web-development/event-listener-managers/priority-listeners/event-name-registries.md) — Stores listener callbacks keyed by event name for fast lookup and priority-ordered execution.
- [Priority-Based Dispatch](https://awesome-repositories.com/f/web-development/routing-systems/routing/matching-algorithms/regex-based-url-dispatchers/handler-dispatchers/priority-based-dispatch.md) — Sorts listeners by assigned integer priority before sequential invocation to control execution order.
