.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Event::ExecFlow 3" .TH Event::ExecFlow 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Event::ExecFlow \- High level API for event\-based execution flow control .SH NOTE .IX Header "NOTE" This is release has nearly no documentation yet. If you're interested in the details please contact the author. .SH ABSTRACT .IX Header "ABSTRACT" Event::ExecFlow provides a ligh level API for defining complex flow controls with asynchronous execution of external programs. .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& 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 =~ /\e[\ed+\-(\ed+)\e]/; \& #\-\- or simply write this: \& #\-\- progress_parser => qr/\e[\ed+\-(\ed+)\e]/, \& }, \& ), \& 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\*(Aqs nevertheless a good \& #\-\- example for the \*(AqCode\*(Aq 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); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" 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. .PP 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. .PP 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. .SH REQUIREMENTS .IX Header "REQUIREMENTS" Event::ExecFlow requires the follwing Perl modules: .PP .Vb 3 \& AnyEvent >= 0.04 \& Locale::TextDomain \& Test::More .Ve .SH INSTALLATION .IX Header "INSTALLATION" You get the latest installation tarballs and online documentation at this location: .PP .Vb 1 \& http://www.exit1.org/Event\-ExecFlow/ .Ve .PP If your system meets the requirements mentioned above, installation is just: .PP .Vb 3 \& perl Makefile.PL \& make test \& make install .Ve .SH AUTHORS .IX Header "AUTHORS" .Vb 1 \& Jörn Reder .Ve .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2005\-2006 by Jörn Reder. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 122:" 4 .IX Item "Around line 122:" Non-ASCII character seen before =encoding in 'Jörn'. Assuming CP1252