eventium-core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Eventium.EventBus

Synopsis

Documentation

synchronousEventBusWrapper :: Monad m => VersionedEventStoreWriter m event -> [VersionedEventStoreWriter m event -> UUID -> event -> m ()] -> VersionedEventStoreWriter m event Source #

This function wraps an event store by sending events to event handlers after running storeEvents. This is useful to quickly wire up event handlers in your application (like read models or process managers), and it is also useful for integration testing along with an in-memory event store.

storeAndPublishEvents :: Monad m => VersionedEventStoreWriter m event -> [UUID -> event -> m ()] -> UUID -> ExpectedPosition EventVersion -> [event] -> m (Either (EventWriteError EventVersion) EventVersion) Source #

Stores events in the store and then publishes them to the event handlers. This is used in the synchronousEventBusWrapper.