extractor to convert a total function into a partial function internally _
A CommandHandlerInvoker holds a PartialFunction from DomainCommand to F[immutable.Seq[DomainEvent]].
A CommandHandlerInvoker holds a PartialFunction from DomainCommand to F[immutable.Seq[DomainEvent]]. F being the higher-kind wrapping the result of handling the command.
Invokers are delayed execution of Command Handlers
and abstract over the
Functor that will be returned when handling the command. Fun.CQRS provides three CommandHandlerInvoker implementations:
IdCommandHandlerInvoker (returns the Identity Functor), TryCommandHandlerInvoker and FutureCommandHandlerInvoker.
A CommandToEvents is a PartialFunction from a DomainCommand to a CommandHandlerInvoker
An EventHandler is a PartialFunction from a DomainEvent to an Aggregate
An EventHandler is a PartialFunction from a DomainEvent to an Aggregate
Typically it is used to construct or update an aggregate. In case of update, an Aggregate instance must be in scope.
A CommandHandlerInvoker which F type member is defined as Future
A CommandHandlerInvoker which F type member is defined as Identity
A CommandHandlerInvoker which F type member is defined as Try