Re: Why no thread.sleep in servlet and a light way to poll from a servlet
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Sat, 18 Aug 2007 22:01:17 -0400
anita wrote:
Hmm.. I read the spec again- it seems to imply that I CAN start my own
threads in a servlet container.
So maybe a TimerTask will do- or a simple Thread.sleep
I dont need to have it happen periodically or anything.
Just want the incoming request to poll a resource a couple of times
before giving up.
You are allowed to do it from a servlet.
If it is something only a single or few users are
doing it is also OK.
If many users will be doing it then you can get
problems with the server.
Why not do it another way like:
- have one request send a message to a message queue
- have a MDB process it
- have the client poll at a reasonable interval to a
servlet that checks if the work is done
?
I would think the container would prefer 3*N requests
that runs quick over N requests that each blocks for
seconds.
Arne
.
- References:
- Prev by Date: Re: Java Enterprise Edition evaluation
- Next by Date: Re: Why no thread.sleep in servlet and a light way to poll from a servlet
- Previous by thread: Re: Why no thread.sleep in servlet and a light way to poll from a servlet
- Next by thread: Re: Why no thread.sleep in Servlet
- Index(es):
Relevant Pages
|