| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Eventium.ProcessManager
Synopsis
- data ProcessManager state event command = ProcessManager {
- processManagerProjection :: Projection state (VersionedStreamEvent event)
- processManagerPendingCommands :: state -> [ProcessManagerCommand event command]
- processManagerPendingEvents :: state -> [StreamEvent UUID () event]
- data ProcessManagerCommand event command = ProcessManagerCommand {
- processManagerCommandTargetId :: UUID
- processManagerCommandCommandHandler :: CommandHandler state event command
- processManagerCommandCommand :: command
- applyProcessManagerCommandsAndEvents :: Monad m => ProcessManager state event command -> VersionedEventStoreWriter m event -> VersionedEventStoreReader m event -> state -> m ()
Documentation
data ProcessManager state event command Source #
A ProcessManager manages interaction between event streams. 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 CommandHandler or Projections in other streams.
Constructors
| ProcessManager | |
Fields
| |
data ProcessManagerCommand event command Source #
This is a command along with the UUID of the target CommandHandler, as
well as the CommandHandler type. Note that this uses an existential type
to hide the state type parameter on the CommandHandler.
Constructors
| ProcessManagerCommand | |
Fields
| |
Instances
| (Show command, Show event) => Show (ProcessManagerCommand event command) Source # | |
Defined in Eventium.ProcessManager Methods showsPrec :: Int -> ProcessManagerCommand event command -> ShowS # show :: ProcessManagerCommand event command -> String # showList :: [ProcessManagerCommand event command] -> ShowS # | |
applyProcessManagerCommandsAndEvents :: Monad m => ProcessManager state event command -> VersionedEventStoreWriter m event -> VersionedEventStoreReader m event -> 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.