An Interpreter with F[_] bounded to Future.
An Interpreter with F[_] bounded to Future.
All command handling are interpreted to Future of Events.
- an Aggregate type
Convenient type alias to make any identity instances well-kinded.
Convenient type alias to make any identity instances well-kinded.
This allow us to use plain values whenever we need higher-kind of one type parameter.
For example:
trait Handlers[F[_]] { def handleCommand(cmd:Command): F[Event] } // implementations of handler can define the type of F object TryHandler extends Handlers[Try] { def handleCommand(cmd:Command): Try[Event] = Try(someEvent()) def someEvent() : Event = ... } object IdentityHandler extends Handlers[Identity] { // since Identity[Event] = Event, we can call someEvent() directly without wrapping it! def handleCommand(cmd:Command): Identity[Event] = someEvent() def someEvent() : Event = ... }
An Interpreter with F[_] bounded to Identity.
An Interpreter with F[_] bounded to Identity.
All command handling are interpreted to Identity of Events (ie: the pure value).
Will block on any async operation defined by Behavior.
This interpreter should be used for testing and / or for behaviors that preferably don't define any async operation.
- an Aggregate type
Base Interpreter trait.
Base Interpreter trait.
Implementors must define which type F must be bound to.
An Interpreter with F[_] bounded to Try.
An Interpreter with F[_] bounded to Try.
All command handling are interpreted to Try of Events.
Will block on any async operation defined by Behavior.
This interpreter should be used for testing and / or for behaviors that preferably don't define any async operation.
- an Aggregate type
Provides type-classes for map and flatMap over Identity, Try and Future