eventful-core-0.1.1: Core module for eventful

Safe HaskellNone
LanguageHaskell2010

Eventful.ProcessManager

Synopsis

Documentation

data ProcessManager state event command Source #

A ProcessManager manages interaction between aggregates. It works by listening to events on an event bus (see processManagerHandler) and applying events to its internal Projection. Then, pending commands and events are plucked off of that Projection and applied to the appropriate Aggregates or Projections in other streams.

data ProcessManagerCommand event command Source #

This is a command along with the UUID of the target Aggregate, and well as the Aggregate instance. Note that this uses an existential type to hide the state type parameter on the Aggregate.

Instances

(Show command, Show event) => Show (ProcessManagerCommand event command) Source # 

Methods

showsPrec :: Int -> ProcessManagerCommand event command -> ShowS #

show :: ProcessManagerCommand event command -> String #

showList :: [ProcessManagerCommand event command] -> ShowS #

data ProcessManagerEvent event Source #

This is an event paired with the UUID of the stream to which the event will be applied.

Instances

data ProcessManagerRouter state event command Source #

A ProcessManagerRouter decides which process manager projection ID to use for a given event.

processManagerHandler :: Monad m => ProcessManagerRouter state event command -> EventStore event m -> UUID -> event -> m () Source #

This is an event handler for a ProcessManager that applies all events to the ProcessManagerRouter, and then applied any pending commands or events to the appropriate places.