eventstore

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(events ...event.Event) event.Store

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

func WithBus(s event.Store, b event.Bus) event.Store

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL