You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This is a **Decorator**. It wraps another `EventStore` implementation.
89
-
* After successfully adding events to the wrapped store using `add()`, it publishes those events to an `EventBus`.
90
-
***Use Cases:** Ensures that events are published to listeners *only after* they have been successfully persisted. This is crucial for system consistency.
91
-
***Configuration:** Takes the underlying `EventStore` and an `EventBus` as constructor arguments.
89
+
* Ensures events are delivered to listeners after being stored.
90
+
* Publishes events to an in-memory event bus used by Streak's infrastructure (e.g., for starting [subscriptions](./listeners.md#running-listeners)).
91
+
* Guarantees that events are only published after successful persistence.
92
+
***Use Cases:**
93
+
* Reliable event delivery to listeners
94
+
* Maintaining consistency between event store and listeners
95
+
* Ensuring events are processed in the order they were stored
96
+
***Configuration:** Takes the underlying `EventStore` and event publishing mechanism as constructor arguments.
92
97
93
98
## Choosing an Implementation
94
99
95
100
* Use `InMemoryEventStore` for your tests.
96
101
* Use `DbalPostgresEventStore` (or potentially other DBAL-based stores if created) for development and production if using PostgreSQL.
97
-
***Always** wrap your primary persistent event store (like `DbalPostgresEventStore`) with `PublishingEventStore`in production/development setups to ensure reliable event publication for read models, process managers, etc.
102
+
***Always** wrap your primary persistent event store with `PublishingEventStore` to ensure reliable event delivery to listeners.
98
103
99
104
Configuration, especially for the DBAL store and serialization, is typically handled via dependency injection, often simplified by the `StreakBundle` if using Symfony.
0 commit comments