Open thangchung opened 7 years ago
Read this for more clear about state machine, workflow and sagas https://medium.com/@roman01la/confusion-about-saga-pattern-bbaac56e622#.7x70mb8q3 Another collection of articles about Sagas at https://github.com/thangchung/magazine-website-akka/wiki/Saga-research
We can use Quartz (https://github.com/quartznet/quartznet) to schedule the job (run forever) and inside that job, we can trigger the stateless's state machine to get it work. Not sure it works or not? Need to check https://stackoverflow.com/questions/25299662/executing-multiple-quartz-net-jobs-with-topshelf I think Topself will boot the Service to run the persistence actor, inside that actor will get events from event store to re-init the state of the Aggregate of entity, then we can instance the stateless's state machine for run in every 1 minute or more by using Quartz
The best way to do here is akka state machine with Quatz
Really nice example using stateless at https://sachabarbs.wordpress.com/2013/05/16/simple-but-nice-state-machine/
A lot of references in case we need to learn more http://blog.jonathanoliver.com/cqrs-sagas-with-event-sourcing-part-i-of-ii/ https://abdullin.com/lokad-cqrs-retrospective/ https://msdn.microsoft.com/en-us/magazine/mt238399.aspx?f=255&MSPPError=-2147217396 https://www.slideshare.net/PieterKoornhof/event-sourcing-and-why-it-is-a-good-choice (https://github.com/SneakyPeet/EasyEventSourcing)
// in the FE https://github.com/paldepind/functional-frontend-architecture/issues/20#issuecomment-158694062 https://blog.javascripting.com/2015/08/12/reduce-your-side-effects/
The next refactor should be as
Good for reference at http://vasters.com/archive/Sagas.html
Consider could we use the https://github.com/dotnet-state-machine/stateless to implement the state-machine for the admin approval the article submission from the editor. Maybe we need to choose the workflow lib to make it work