That's a good question! It depends on what you are doing. In this case perhaps the best use of resources is to execute `something` within the receive block. For other cases you may want to spawn child-actors to deal with the Work-In-Progress, and for certain cases you may want o to use Stashing.
On Fri, Nov 14, 2014 at 11:11 PM, david l <[email protected]> wrote: > Thank you. > > So, if my actor system is non-blocking throughout, what techniques are > recommended for storing the state of outstanding uncompleted futures? > > A map of correlation ids in the sending actor seems awkward. > > Thanks again. > > > > On Friday, November 14, 2014 5:01:29 PM UTC-5, √ wrote: >> >> Yes, the actor will continue with the next message as soon as its >> receive-behavior returns. >> >> On Fri, Nov 14, 2014 at 10:52 PM, david l <[email protected]> wrote: >> >>> Hello Akka users, >>> >>> I have a newbie question about message processing when a async request >>> is fired off.... >>> >>> class MyActor extends Actor{ >>> >>> >>> def receive = LoggingReceive{ >>> case _ => >>> val s = sender >>> future{ something } onComplete { >>> s ! Result() >>> } >>> } >>> >>> When a message is received, "something" is executed in another thread. >>> >>> What I'm puzzled about is, even with the use of closures and other >>> tricks to capture the context of the sender, won't the actor "move on" to >>> the next message? >>> >>> It's possible that "something" takes so long that lots of subsequent >>> messages would be processed even before the callback is executed. >>> >>> What am I missing? >>> >>> Thanks >>> >>> David >>> >>> -- >>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/ >>> current/additional/faq.html >>> >>>>>>>>>> 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 [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at http://groups.google.com/group/akka-user. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Cheers, >> √ >> > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Cheers, √ -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
