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 
<[email protected]> 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 to cancel messages 
> using PriorityMailbox for this scenario?
> 
> --
> Martynas Mickevičius
> Typesafe – Reactive Apps on the JVM

-- 
>>>>>>>>>>      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.

Reply via email to