Note that there are some explanatory texts on larger screens.

plurals
  1. POJ Oliver CommonDomain saga sample
    primarykey
    data
    text
    <p>I was playing around with Jonathan Oliver's CommonDomain Saga Implementation. For me to wrap my head around this, I implemented a simple saga a below and an in memory saga repository. I am doing this to really understand how sagas will work under various scenarios. Before I put in a NSB or another framework, I needed to play with this to better understand the concept.</p> <p>I am not sure if I am using this correctly though. There are no tests or sample implementation for CommonDomain saga. I used the saga as event handlers for the events it transitions.</p> <p>Does this make sense? Any feedback would be appreciated.</p> <pre><code>public class QueryExecutionSaga : SagaBase&lt;IEvent&lt;QueryExecutionID&gt;&gt;, IEventHandler&lt;QueryExecutedNow&gt;, IEventHandler&lt;QueryExecutionCancelled&gt; { public QueryID QueryID { get; private set; } public QueryExecutionID QueryExecutionID { get; private set; } public QueryExecutionSaga() { Register&lt;QueryExecutedNow&gt;(Handle); Register&lt;QueryExecutionCancelled&gt;(Handle); } #region Implementation of IEventHandler&lt;in QueryExecutedNow&gt; public void Handle(QueryExecutedNow theEvent) { ID = new SagaID(theEvent.Identity.Identifier); QueryID = theEvent.QueryID; QueryExecutionID = theEvent.Identity; // send prepare query results command } #endregion #region Implementation of IEventHandler&lt;in QueryExecutionC.ancelled&gt; public void Handle(QueryExecutionCancelled theEvent) { // send notify sender command } #endregion public void Handle(IEvent&lt;IIdentity&gt; e) { Transition(e); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload