users@grizzly.java.net

Async or not async, this is the problem

From: rama <rama.rama_at_tiscali.it>
Date: Wed, 3 Dec 2008 20:44:41 +0100

Ok, sorry for the obj of mail, i wasn't able to think on nothing of
better :D


Let me try to explain the problem, that i have summarized with this 3
class.

WebServer.java (just start a ws)
MyAdapter.java (the adapter)
Session.java (session manager)

Lest's begin :)

if someone request url push, i need to procede as follow.
I create a new session for that user (based on a cookie or whatever,
this is not of our concern)
then, i check if in session msg list there is something to send, if
yes, send it, if not, wait until something is ready.

Basically, this work like a charm, but i hold a thread until the
message arrive to session queue.

So, what's happen if i have 100 user that want to ask for their msg?
i wait forever :(

I have try to take a look to asyncadapter, but honestly, i don't know
where to start.
I already have a read of cometd, but was really too much for me :D

Someone can give to me a hint on where to start to take a look to
solve this problem?

Best regards

(i add the java, don't know if is useful or allowed here)

bye!