Posted By:
Bogdan_Sheptunov
Posted On:
Wednesday, June 5, 2002 08:50 AM
Hi guys, I am looking for a design decision and I am not sure is there a pattern for that already or not. I don't really like what I have right now and am looking for a healthy criticism :) Here is my need. The server's (serlvets/Tomcat) main role is to accept, schedule and execute some long running (minutes) jobs. The jobs have to run one after another (not two at a time), and the processing has to be as close to real time as possible. What I was gonna do right now is to have a servlet accepting the incoming jobs and storing them into my implementation of Priority Queue. Then I was going to have a separate Thread activated at startup time, which would wake up every N seconds, check the queue, pick up 1
More>>
Hi guys,
I am looking for a design decision and I am not sure is there a pattern for that already or not. I don't really like what I have right now and am looking for a healthy criticism :)
Here is my need. The server's (serlvets/Tomcat) main role is to accept, schedule and execute some long running (minutes) jobs. The jobs have to run one after another (not two at a time), and the processing has to be as close to real time as possible.
What I was gonna do right now is to have a servlet accepting the incoming jobs and storing them into my implementation of Priority Queue. Then I was going to have a separate Thread activated at startup time, which would wake up every N seconds, check the queue, pick up 1 job and start it's execution.
My question is are there any better/known ways of implementing that? Somehow I don't like that separate thread hanging around, because those N seconds of having it asleep might be important. But I don't see the other way to provide for next job to run.
Thanks, Bogdan.
<<Less