Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a thread-safe in-memory event store. The provided events are immediately inserted into the store.
This event store is not production ready. It is intended to be used for testing and prototyping. In production, use the MongoDB event store instead. TODO(bounoable): List other event store implementations when they are ready.
func WithBus ¶
WithBus decorates the given event store with the given event bus. Events are published over the bus after being inserted into the store.
Insertion and publishing of events are not performed in a single transaction, which could cause a data loss if the bus fails to publish the events after insertion. To prevent this, check if there exists solution specific to the used event store implementation. For example, the MongoDB backend provides a service that subscribes to MongoDB Change Streams to publish events as they are inserted into the database.
TODO(bounoable): Actually implement the MongoDB Change Streams service.
Types ¶
This section is empty.