I have a saga that can end one of two ways.
1. normally: that is the saga behaves as it's suppose to and notify the user
2. forced: if the saga is not completed in 30 minutes. complete the saga 
anyway.

class mysaga
   : isaga<state>
   , initiatedby<start>
   , orchestrates<endnormally>
   , orchestrates<endforcefully>
{
    void consume(start message)
    {
          var delay = datetime.now.addminutes(30);
          bus.DelaySend(delay, new endforcefully());
          bus.Send(new endnormally());
    }

    void consume(endnormally message)
    {
          notifyuserthesagaiscomplete();
          IsComplete = true;
    }

    void consume(endforcefully message)
    {
          warn("ended forcefully");
          IsComplete = true;
    }
}

I'm am receiving errors "Got message endforcefully, but had no consumers for 
it". Which makes sense because the saga was deleted from storage upon 
completion. I thought this type of setup was common to ensure sagas 
completed though? similar to the process of confirming a user signed up for 
an account (and not a bot). What would be a better approach to forcing the 
completion of a saga?

I am using PHT to store the sagas.

i could configure a timer to delete entries in the PHT that are older than 
30 minutes. but then I have to 
1. store the id somewhere to retrieve the saga
2. somehow know the saga is more than 30 minutes old. I could do that by 
storing a value in the saga state, but that seems like hack.

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en.

Reply via email to