>>If you are interested, I could probably post some example code.<<

Please. That would be a big help to me and might help form some concensus around best 
practices for this sort of thing.

-----Original Message-----
From: John Dickinson [mailto:[EMAIL PROTECTED]
Sent: Friday, May 21, 2004 3:07 PM
To: [EMAIL PROTECTED]
Cc: Ian Sparks
Subject: Re: [Webware-discuss] Task-Queue using Webware...


I've done a similar thing with one of our Webware applications. I started the thread 
in my webware servlet. Once I started the worker thread, I set a refresh header in the 
servlet to keep reloading the page (say, every 5 seconds). The main function for the 
thread was one of the methods of my servlet class, so I was able to use a session 
variable to keep track of the status of my worker thread. When I created the worker 
thread, I set some session variables to let me know if it had been created and started 
and whatnot. Those variables prevented me from trying to recreate the thread on each 
page refresh. Now, I had a lot of control over the environment for this process, so 
I'm not sure how well this would scale, but it worked for me.

If you are interested, I could probably post some example code.

--John

On Fri, 21 May 2004 11:25:56 -0400
"Ian Sparks" <[EMAIL PROTECTED]> wrote:

> Hi all,
> 
> I have a situation where I need to submit long-running tasks via a Webware 
> application. These tasks are CPU intensive and can take up to a few minutes to 
> complete.
> 
> What I do at the moment is spawn a thread from the servlet to do the processing and 
> let the servlet return to do more work.
> 
> This works OK but I'd like to find out the status of those jobs and I'd also like to 
> make sure that I'm not trying to do several of these tasks at once because they will 
> bring the sever to a crawl..
> 
> So I was thinking of creating a queue and having a worker thread busy away on it, 
> reporting its progress back to the application in some way.
> 
> Has anyone done this with webware? Advice? Pitfalls to avoid?
> 
> Thanks.
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle 10g. 
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id149&alloc_id66&op=click
> _______________________________________________
> Webware-discuss mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
> 


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id66&op=click
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to