P0w3rK!d has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I am developing a component to my application which has to performing queuing. Taking into account n clients and n resources, consider what approach you would take to queueing up the clients...

My approach is to have 1 controller written in Perl to manage a FIFO/flat file queue on each resource. As there is a request for a resource, the client's task is added to the file and processed. There will be a limitation to the number of requests at any given time. Hence, if the queue is full, the client is turned away. If the client succeeds, once they are served, I need to give a status for the process which they are running (what stage it is at, etc.). I also need to perform stopping/removal of items in the queue (similar to removing items from a FIFO print queue).

I am not looking for a solution, as I already have defined it. My questions are:

Do my fellow monks know of any Perl modules which perform different types of queuing?

Furthermore, any which manage queued processes?

Based on those answers, is it a good idea to keep the queue files on each resource(server) or keep them all on the one controller? ..as I can do either.

Thank you. :)
-P0w3rK!d

Replies are listed 'Best First'.
Could be a good chance to play with POE...
by RMGir (Prior) on May 30, 2002 at 16:10 UTC
    POE::Component::JobQueue

    I've never used POE myself, but it does look very interesting. And that module looks like it does exactly what you want, I think...
    --
    Mike

Re: Perl and Queues
by perrin (Chancellor) on May 30, 2002 at 17:08 UTC
    You might find it works better to use BerkeleyDB than a flat file for this. It has a queue mode (basically an on-disk array).