You replied to my email but addressed Martynas, which solution worked for you?
Cheers, V On Apr 9, 2014 6:56 PM, "MV" <[email protected]> wrote: > Thanks a lot Martynas. That worked very well actually. I did not even need > to do the Agent thing or the Priority Mail box solution. > > Thanks a lot and hope I am not going to bug you too soon :-) > Meena > > On Wednesday, April 9, 2014 9:01:21 AM UTC-4, √ wrote: >> >> def receive = { >> case Next => >> doWork() >> self ! Next >> } >> >> >> On Wed, Apr 9, 2014 at 2:36 PM, MV <[email protected]> wrote: >> >>> Thanks Martynas :-) But what is a continuation message? >>> Can I get an example or sample pseudocode for my while loop pseudocode? >>> >>> Assuming that RequestProcessor -> Sends RequestInfo_1 to -> >>> DataBaseWorker (this uses the while loop) >>> Some time later: RequestProcessor ->Sends Cancel_RequestInfo_1 -> >>> DataBaseWorker (this should quit the while loop midway) >>> >>> Thanks again for the quick response - really helping my time crunch :-) >>> Meena >>> >>> >>> On Wednesday, April 9, 2014 7:40:15 AM UTC-4, √ wrote: >>> >>>> Don't use a while loop, send continuation messages. :) >>>> On Apr 9, 2014 12:32 PM, "Meena Venkat" <[email protected]> wrote: >>>> >>>>> Hi Martynas >>>>> >>>>> Thank you very much for a prompt reply. >>>>> As far as Agent question is concerned - YES - for now the application >>>>> is running on a single node - so I think it should be ok. But thanks for >>>>> pointing that out as i don't think I saw that note in the documentation. >>>>> So what is alternative if this was going to be a distributed >>>>> application? >>>>> >>>>> As far as PriorityMailbox solution is concerned - I found that it will >>>>> work for my other problem I posted for that question. >>>>> So I have TWO ConsistentHashingPool workers: >>>>> >>>>> DatabaseWorker and >>>>> ResultProcessor. >>>>> >>>>> For the ResultProcessor - it is a simple onReceive() implementation >>>>> where there is no "While loop" processing information. It takes a message >>>>> from mailbox, does some simple calculation and returns results. There is >>>>> no >>>>> blocking. >>>>> So in this case - where there were 4 time slice messages in the queue >>>>> and I want the CANCEL to take precedence, the PriorityQueue implementation >>>>> will be perfect. I still need to implement and try this :-) I will keep >>>>> you >>>>> posted on it goes. >>>>> >>>>> For the DatabaseWorker - as mentioned on the post, once it takes ONE >>>>> message from the queue - It divides the message into 'n' number of time >>>>> slice queries. So the onREceive for message 1 uses: >>>>> while (moreTimeSlices) >>>>> { >>>>> results = quereyDatabase(); >>>>> resultProcessorWorker.tell(results) >>>>> } >>>>> >>>>> My understanding with onREceive() is that this method will NOT RETURN >>>>> until the WHILE loop has finished executing ALL time slices. Is this >>>>> correct? >>>>> Assuming this is true, I need a way to cancel the While loop midway by >>>>> checking a flag and sending a CANCEL in priority queue will not work. This >>>>> is because the CANCEL message will not be pulled from the mailbox until >>>>> ALL >>>>> time slices have been processed in the while loop. >>>>> >>>>> Does this make the issue clearer? >>>>> I am new to AKKA system, so I do appreciate any alternative >>>>> suggestions I can get to resolve this issue. >>>>> >>>>> Looking forward to your response, >>>>> Meena >>>>> >>>>> >>>>> >>>>> On Apr 9, 2014, at 6:16 AM, Martynas Mickevičius <martynas.m...@ >>>>> typesafe.com> wrote: >>>>> >>>>> This could work, but you would have to make sure that all the actors >>>>> which share that agent are running on the same node. >>>>> >>>>> Did you consider using solution from yesterdays >>>>> discussion<https://groups.google.com/forum/#!topic/akka-user/RVQ9IJDJi1c> >>>>> to >>>>> cancel messages using PriorityMailbox for this scenario? >>>>> >>>>> -- >>>>> Martynas Mickevičius >>>>> Typesafe <http://typesafe.com/> – >>>>> Reactive<http://www.reactivemanifesto.org/> Apps >>>>> on the JVM >>>>> >>>>> >>>>> -- >>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/c >>>>> urrent/additional/faq.html >>>>> >>>>>>>>>> Search the archives: https://groups.google.com/grou >>>>> p/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. >>>>> >>>> -- >>> >>>>>>>>>> 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. > -- >>>>>>>>>> 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.
