Skip to content

Commit

Permalink
made it clear that I (lovingly) stole most of the code in lib/IPC/Pip…
Browse files Browse the repository at this point in the history
…eline/Continuous.pm
  • Loading branch information
Stephen R. Scaffidi committed Mar 23, 2012
1 parent 704f709 commit fd8d1b8
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions lib/IPC/Pipeline/Continuous.pm
@@ -1,17 +1,23 @@
package IPC::Pipeline::Continuous;

use strict; use strict;
use warnings; use warnings;
package IPC::Pipeline::Continuous;

# ABSTRACT: a pipeline where the ends don't have to be 'pumped'

###
### THIS CODE BASED HEAVILY ON IPC::Pipeline v0.4
### BY Erin Schönhals <wrath@cpan.org>.
### HOWEVER, THE BUGS ARE ALL MINE :)
###


use POSIX (); use POSIX ();
use Data::Dumper; use Data::Dumper;
use Scalar::Util qw(reftype); use Scalar::Util qw(reftype);


BEGIN { BEGIN {
use Exporter (); use Exporter ();
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);


$VERSION = '0.4';
@ISA = ('Exporter'); @ISA = ('Exporter');
@EXPORT = qw(pipeline pipeline_c); @EXPORT = qw(pipeline pipeline_c);
@EXPORT_OK = (); @EXPORT_OK = ();
Expand Down Expand Up @@ -145,13 +151,9 @@ sub exec_filter {


__END__ __END__
=head1 NAME
IPC::Pipeline - Create a shell-like pipeline of many running commands
=head1 SYNOPSIS =head1 SYNOPSIS
use IPC::Pipeline; use IPC::Pipeline::Continuous;
my @pids = pipeline(\*FIRST_CHLD_IN, \*LAST_CHLD_OUT, \*CHILDREN_ERR, my @pids = pipeline(\*FIRST_CHLD_IN, \*LAST_CHLD_OUT, \*CHILDREN_ERR,
[qw(filter1 args)], [qw(filter1 args)],
Expand All @@ -168,6 +170,16 @@ IPC::Pipeline - Create a shell-like pipeline of many running commands
$_ => ($? >> 8); $_ => ($? >> 8);
} @pids; } @pids;
=head1 ATTRIBUTION
The code in this module is based B<heavily> on L<IPC::Pipeline> v0.4 by
Erin Schönhals <wrath@cpan.org>. Like, I copied almost all of it directly.
While I made a number of modifications, L<IPC::Pipeline::Continuous>
I<should> work as a drop-in-replacement, and so I've kept her documentation.
(it does pass all of IPC::Pipeline's tests). The new functionality I added
is highly experimental and is currently only suitable for use by folks who
are willing to read the code, hence it not being documented at this time.
=head1 DESCRIPTION =head1 DESCRIPTION
Similar in calling convention to IPC::Open3, pipeline() spawns N children, Similar in calling convention to IPC::Open3, pipeline() spawns N children,
Expand All @@ -179,7 +191,7 @@ using dup2() to chain each process' standard input to the last standard output.
=head2 FEATURES =head2 FEATURES
IPC::Pipeline accepts external commands to be executed in the form of ARRAY IPC::Pipeline::Continuous accepts external commands to be executed in the form of ARRAY
references containing the command name and each argument, as well as CODE references containing the command name and each argument, as well as CODE
references that are executed within their own processes as well, each as references that are executed within their own processes as well, each as
independent parts of a pipeline. independent parts of a pipeline.
Expand Down

0 comments on commit fd8d1b8

Please sign in to comment.