"So when you either send messages you will take them from a queue andwhen you read messages you will put them in a queue?"
In fact it's the way around ;-) . Mina is event driven so I guess I have to put my processing loop in a separate Thread. I will need to create a Queue so Mina can stack messages in it and my loop can read it (simply producer-consumer). I'm scared that this solution is no efficient and there might be a way with Mina to achieve the same result in only one Thread. Sorry if I'm not clear enough and for my bad english but I try my best ;-) Thanks a lot for all the replies, orel ________________________________ De : Mark Webb <[EMAIL PROTECTED]> À : [email protected] Envoyé le : Samedi, 15 Novembre 2008, 2h28mn 37s Objet : Re: read messages in a processing loop So when you either send messages you will take them from a queue and when you read messages you will put them in a queue? This seems reasonable, but I feel that I am missing someting here. On Fri, Nov 14, 2008 at 8:22 PM, Boubennec Aurelien <[EMAIL PROTECTED]> wrote: > Hi all, > > I am new at Mina. > > On both server and client side, there is a loop running at a certain > frequency. > > I just wonder which way is the best to read received messages on both sides > to get a pretty low latency. > > > What I plan to do is to add the messages into a SynchronizedQueue . > I would read the messages by adding a "readQueue()" method in the loops. > I would also set a maximum amount of time for "readQueue()" for polling so > the loop-frequency isn't disturbed. > > Is it a good idea or anyone has a better solution ? (I guess my solution is > pretty naive though) > > > Thanks a lot in advance for your help. > > orel > > >
