Event::ExecFlow(3pm)
β¨ NAME β¨
Event::ExecFlow β high level API for event-based execution flow control π (it's a Perl module, from the User Contributed Perl Documentation corner of the universe, and it's lowkey a whole vibe)
π NOTE π
okay bestie, real talk first: this release has nearly no documentation yet π like, the docs are giving "came to the party but forgot her outfit". If you're interested in the details, pls just contact the author π«Ά
π¦ ABSTRACT π¦
Event::ExecFlow provides a ligh level API for defining complex flow controls with asynchronous execution of external programs. (yes, "ligh" β that's the original's typo and we're keeping it, no cap, character for character π«‘)
β SYNOPSIS β
use Event::ExecFlow;
my $job = Event::ExecFlow::Job::Group->new (
jobs => [
Event::ExecFlow::Job::Command->new (
name => "transcode",
title => "Transcoding DVD title to OGG",
command => "transcode -i /dev/dvd ...",
fetch_output => 1,
progress_max => 4711, # number of frames
progress_parser => sub {
my ($job, $buffer) = @_;
$job->set_progress_cnt($1) if $buffer =~ /\[\d+-(\d+)\]/;
#-- or simply write this:
#-- progress_parser => qr/\[\d+-(\d+)\]/,
},
),
Event::ExecFlow::Job::Code->new (
name => "checks",
title => "Do some checks",
depends_on => [ "transcode" ],
code => sub {
my ($job) = @_;
my $transcode = $job->get_group->get_job_by_name("transcode");
if ( $transcode->get_output !~ /.../ ) {
$job->set_error_message("XY check failed");
}
#-- this could be done easier as a post_callback added to
#-- the "transcode" job above, but it's nevertheless a good
#-- example for the 'Code' job type and shows how jobs can
#-- interfere with each other.
},
),
Event::ExecFlow::Job::Command->new (
title => "Muxing OGG file",
depends_on => [ "checks" ],
command => "ogmmerge ...",
no_progress => 1,
),
],
);
#-- this inherits from Event::ExecFlow::Frontend
my $frontend = Video::DVDRip::GUI::ExecFlow->new(...);
$frontend->start_job($job);
π DESCRIPTION π
so Event::ExecFlow offers a high level API to declare jobs, which mainly execute external commands, parse their output to get progress or other status information, triggers actions when the command has been finished etc. π Such jobs can be chained together in a recursive fashion to fulfill rather complex tasks which consist of many jobs. it's giving main character energy for your shell scripts, fr fr π₯
Additionally it defines an extensible API for communication with the frontend application, which may be a written using Gtk2, Tk or Qt or is a simple text console program. pick your fighter bestie π
In case of Gtk2 a custom widget for displaying an Event::ExecFlow job plan, including progress updates, is shipped with the Gtk2::Ex::FormFactory package. cute widget, iconic behaviour, we love to see it π
πΈ REQUIREMENTS πΈ
Event::ExecFlow requires the follwing Perl modules (yes "follwing", we're preserving the typo, obsessed π):
AnyEvent >= 0.04
Locale::TextDomain
Test::More
note the AnyEvent >= 0.04 β that version number is load-bearing, don't @ me π
π§ INSTALLATION π§
You get the latest installation tarballs and online documentation at this location:
http://www.exit1.org/Event-ExecFlow/
If your system meets the requirements mentioned above, installation is just:
perl Makefile.PL
make test
make install
like that's it. three commands. slay. β¨
π AUTHORS π
JΓΆrn Reder <joern at zyn dot de>
π COPYRIGHT AND LICENSE π
Copyright 2005-2006 by JΓΆrn Reder.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
(so: free software, same terms as Perl itself, periodt π )
π POD ERRORS π
Hey! The above document had some coding errors, which are explained below:
Around line 122:
Non-ASCII character seen before =encoding in 'JΓΆrn'. Assuming CP1252
not the CP1252 assumption π the parser really said "I'll guess" and honestly? valid of it.
this was Event::ExecFlow(3pm) from the User Contributed Perl Documentation, brought to you by perl v5.38.2, dated 2024-02-17 β mwah, take care of her, she's an icon π
ππ¦
π¦ where this page comes from
- ubuntu noble: libevent-execflow-perl 0.64-0ubuntu4 Β· GPL-2.0-only
- ubuntu questing: libevent-execflow-perl 0.64-0ubuntu4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms