ashleydawson/domain-event-dispatcher-bundle
DomainEventDispatcher is a singleton, which simplifies global access but may introduce global state risks if not managed carefully (e.g., thread safety in non-Symfony contexts, though Symfony’s request lifecycle mitigates this).kernel.terminate), which is useful for asynchronous workflows (e.g., logging, notifications) without blocking the main request flow.domain-event-dispatcher library, which may have its own quirks or undocumented behaviors.kernel.terminate, which may not suit high-throughput or long-running applications requiring true async processing.EventDispatcher, Messenger Component, or ReactPHP for async) that are better maintained?EventTestCase)?EventDispatcher (simpler, but lacks DDD-specific features)?domain-event-dispatcher library.config/bundles.php (Symfony 4+) or AppKernel.php (legacy).config/packages/ashley_dawson_domain_event_dispatcher.yaml (if needed).ashley_dawson.domain_event_listener in services.yaml.kernel.terminate for deferred dispatching (may conflict with other bundles using the same event).kernel.terminate, which could delay request completion under high load.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Bundle incompatibility with Symfony | Events fail to dispatch; app crashes or behaves unexpectedly. | Test thoroughly; patch or fork if needed. |
| Deferred events accumulate | Memory bloat; requests hang or time out. | Limit deferred events; use async queues instead. |
| Listener errors | Unhandled exceptions may crash the app or leave events undispatched. | Implement error handling in listeners; use try-catch. |
| Singleton misuse | Global state causes race conditions or unpredictable behavior. | Avoid global access; pass dispatcher as a service dependency where possible. |
| Abandonware | No updates for security/CVE fixes. | Monitor for forks; migrate to maintained alternatives (e.g., Messenger). |
How can I help you explore Laravel packages today?