Re: [akka-user] Re: Using actors instead of futures and validations

85 views
Skip to first unread message

Rich Dougherty

unread,
Feb 24, 2013, 7:37:15 PM2/24/13
to akka...@googlegroups.com
I think Tristan's suggestion is a good one. Note also that if you use an actor per saga you won't need to create an id for the saga, you can just use the coordinating actor's identity, i.e. its ActorRef.

Cheers
Rich


On Mon, Feb 25, 2013 at 8:23 AM, Tristan Slominski <tristan....@gmail.com> wrote:
Hey Anthony,

Have you considered how Sagas are implemented in Service Oriented Architectures? Your description seems to describe a problem commonly solved with Sagas. You can find more on this particular pattern here: http://www.udidahan.com/2009/04/20/saga-persistence-and-event-driven-architectures/   . With Sagas in mind, you could create a Saga actor responsible for coordinating everything, and forwarding the result once it receives everything it needs. I would highlight that it appears you'd need one actor instance per Saga if you're not using a database to store the Sagas.

On Saturday, February 23, 2013 8:38:33 PM UTC-6, Anthony wrote:
So, I resisted the urge to further hijack the thread "silent mapTo failure on bad cast?" containing this message https://groups.google.com/d/msg/akka-user/P5NadnLjrh4/ZcQ8QLweCdoJ.

I was hoping someone could discuss or point me to an example of replacing futures with actors as Roland suggests. Let's say I need to validate 3 things to return some result. As Roland suggests, I might use a for comprehension to consolidate the 3 Futures from those validations. How would that look with actors? I'm guessing I would have 3 actors perform the validation and tell their responses to a fourth, but is there a standard solution for how that fourth actor keeps track of it all? Maybe I need to send some kind of unique id to the 3 actors that they will include in their messages so the fourth can correlate the responses? Then of course that fourth actor has to decide how to store the results from perhaps multiple response sets and act on only complete response sets when available. Or maybe I'm missing the simpler solution that was implied.

Thanks,

--Anthony

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages