• Configured via a markup language file
  • Provide a way to query current status and runtime statistics from the steps being executed
  • Be a turnkey solution that does not required a lot of work to install on a new system

Two out of three ain't bad :) And the third could be added fairly simply using a thread and a listener:

#! perl -slw use strict; my( %scripts, %deps, %sched, @starts ); while( <DATA> ) { chomp; my( $name, $script, @deps ) = split '[ \t:,]+'; $scripts{ $name } = $script; if( @deps ) { $deps{ $name } = { map{ $_ => 1 } @deps }; push @{ $sched{ $_ } }, $name for @deps; } else { push @starts, $name; } } my %running = map{ system( 1, $scripts{ $_ } ) => $_ } @starts; while( keys %running ) { my $donePid = wait; my $done = delete $running{ $donePid } or next; for my $action ( @{ $sched{ $done } } ) { delete $deps{ $action }{ $done }; next if keys %{ $deps{ $action } }; $running{ system( 1, $scripts{ $action } ) } = $action; } } __DATA__ Action1: action1.pl Action1a: action1a.pl Action1 Action2: action2.pl Action2a: action2a.pl Action2 Action3: action3.pl Action1a, Action2a Action4: action4.pl Action3 Action5: action5.pl Action4 Action6: action6.pl Action5 Action7: action7.pl Action5 Action8: action8.pl Action6, Action7 Action9: action9.pl Action8 Action10: action10.pl Action1a, Action2a Action11: action11.pl Action8

And a run against action scripts that print "starting"; sleep 10; print "Ending":

[ 1:14:45.39] C:\test>980970 Action1 starting Action2 starting Action1 ending Action2 ending Action1a starting Action2a starting Action1a ending Action2a ending Action3 starting Action10 starting Action3 ending Action10 ending Action4 starting Action4 ending Action5 starting Action5 ending Action6 starting Action7 starting Action6 ending Action7 ending Action8 starting Action8 ending Action9 starting Action11 starting Action9 ending Action11 ending

Of course, it needs some error checking and system(1, ... ) only works on Windows, so that would need changing for other OSs, but as a starting point it shows that you don't need to get complicated for something like this.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?


In reply to Re: Threaded Application Sequencing/Rendezvous by BrowserUk
in thread Threaded Application Sequencing/Rendezvous by learnedbyerror

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.