Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data ProcessManager state event command = ProcessManager {
- processManagerProjection :: Projection state (ProjectionEvent event)
- processManagerPendingCommands :: state -> [ProcessManagerCommand event command]
- processManagerPendingEvents :: state -> [ProjectionEvent event]
- data ProcessManagerCommand event command = ProcessManagerCommand {
- processManagerCommandAggregateId :: UUID
- processManagerCommandAggregate :: Aggregate state event command
- processManagerCommandCommand :: command
- applyProcessManagerCommandsAndEvents :: Monad m => ProcessManager state event command -> EventStore event m -> state -> m ()
Documentation
data ProcessManager state event command Source #
A ProcessManager
manages interaction between aggregates. It works by
listening to events on an event bus and applying events to its internal
Projection
(see applyProcessManagerCommandsAndEvents
). Then, pending
commands and events are plucked off of that Projection and applied to the
appropriate Aggregates or Projections in other streams.
ProcessManager | |
|
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.
ProcessManagerCommand | |
|
applyProcessManagerCommandsAndEvents :: Monad m => ProcessManager state event command -> EventStore event m -> state -> m () Source #
Plucks the pending commands and events off of the process manager's state and applies them to the appropriate locations in the event store.