Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Queuing system for running a perl program

by Anonymous Monk
on May 08, 2014 at 12:24 UTC ( #1085454=note: print w/ replies, xml ) Need Help??


in reply to Re: Queuing system for running a perl program
in thread Queuing system for running a perl program

Hi guys,
thanks to all for your time...Some clarifications:
1) No, the "Extra" software that is being executed, cannot be re-written in Perl, there are complex programs, can't touch them...
2)What I am thinking to do is have a random-string generator subroutine, so that the files generated for each user are separated from those of the others. Sound reasonable approach?
Is there somehow a way to say, have Perl tell me that "Now I started processing this ID" and then associate this unique ID to the current process and Perl tell me that "Now I finished with this ID"? In that scenario, I would know when each full-process has ended and re-direct the user to the output page... Maybe some kind of intermediate "Your query is being processed page" could be helpful? In that case, is this done by PHP, Perl, Javacript?


Comment on Re^2: Queuing system for running a perl program
Re^3: Queuing system for running a perl program
by GrandFather (Cardinal) on May 08, 2014 at 12:52 UTC

    You may be interested in Data::GUID for generating your unique process ID.

    If your processing code runs on a single system you can use PIDs to uniquely identify currently running processes. If you are running across a number of systems use a GUID to identify a task and map that to a system name and PID to allow monitoring task progress. This stuff is commonly enough done that much of it is likely already provided in a module, but my quick CPAN search didn't turn up anything promising.

    Perl is the programming world's equivalent of English
Re^3: Queuing system for running a perl program
by hippo (Curate) on May 08, 2014 at 12:54 UTC
    What I am thinking to do is have a random-string generator subroutine, so that the files generated for each user are separated from those of the others. Sound reasonable approach?

    It may seem like that now, but don't do this. Sooner or later the generator will repeat one of the random strings and then the trouble begins. Better to use a truly unique identifier (which could be as simple as an incrementing integer).

Re^3: Queuing system for running a perl program
by wjw (Deacon) on May 08, 2014 at 13:04 UTC
    As mentioned by another poster(and a good point), there is in fact, a lot of 'prior art' out there.

    Also, as mentioned by yet another poster, there are in fact existing schedulers which would handle this.

    What you propose is certainly doable with Perl(and others). Again, I have to wonder how long the user will be waiting.
    If the user is expected to wait a few seconds, no problem. If longer...? Regardless, I personally would have Perl put out
    that "please wait for..." page. Your back-end knows what is going on, let it inform the front end. There is no penalty that I can
    think of for doing it that way. To keep the user more or less engaged, have Perl spit out some javascript which probes the server
    for the state of the job and updates the user every 10 seconds or so...

    Just a thought... .

    ...the majority is always wrong, and always the last to know about it...
    Insanity: Doing the same thing over and over again and expecting different results...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1085454]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-08-28 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (257 votes), past polls