RikerES
An event sourcing and CQRS astraction that aims to be practical more than "go by the book". It's built on top of Riker a lightweight actor framework.
WARNING It's pretty much alpha quality at the moment, features are still missing and the API is still changing.
How to use
This library adds a few extra event-sourcing related concepts to Riker, entities represent a domain and are the entry point where external commands and bussiness logic is handled. Created with the Entity
actor using the usual Riker machinery(see creating actors).
let entity = actor_system. `;
Defining your entity
MyEntity
is a user supplied struct that implements the ES
trait.
;
Aggregates and rehidrating an entity's state
Define your aggregate(the data model), the updates it can handle and how to apply them.
Dispatching commands and queries
RikerES provides an entity manager that will hold references to your registered entities and provide a simpler API to send commands and queries to the right entity.
let mgr = new.;
let id = mgr.command.await;
let data = mgr..await.unwrap;