Child-0.013000755001750001750 012732526351 13067 5ustar00exodistexodist000000000000README100644001750001750 1162012732526351 14050 0ustar00exodistexodist000000000000Child-0.013NAME Child - Object oriented simple interface to fork() DESCRIPTION Fork is too low level, and difficult to manage. Often people forget to exit at the end, reap their children, and check exit status. The problem is the low level functions provided to do these things. Throw in pipes for IPC and you just have a pile of things nobody wants to think about. Child is an Object Oriented interface to fork. It provides a clean way to start a child process, and manage it afterwords. It provides methods for running, waiting, killing, checking, and even communicating with a child process. NOTE: kill() is unpredictable on windows, strawberry perl sends the kill signal to the parent as well as the child. SYNOPSIS BASIC use Child; my $child = Child->new(sub { my ( $parent ) = @_; .... # exit() is called for you at the end. }); my $proc = $child->start; # Kill the child if it is not done $proc->is_complete || $proc->kill(9); $proc->wait; #blocking IPC # Build with IPC my $child2 = Child->new(sub { my $self = shift; $self->say("message1"); $self->say("message2"); my $reply = $self->read(1); }, pipe => 1 ); my $proc2 = $child2->start; # Read (blocking) my $message1 = $proc2->read(); my $message2 = $proc2->read(); $proc2->say("reply"); SHORTCUT Child can export the child() shortcut function when requested. This function creates and starts the child process in one action. use Child qw/child/; my $proc = child { my $parent = shift; ... }; You can also request IPC: use Child qw/child/; my $child = child { my $parent = shift; ... } pipe => 1; DETAILS First you define a child, you do this by constructing a Child object. Defining a child does not start a new process, it is just the way to define what the new process will look like. Once you have defined the child you can start the process by calling $child->start(). One child object can start as many processes as you like. When you start a child an Child::Link::Proc object is returned. This object provides multiple useful methods for interacting with your process. Within the process itself an Child::Link::Parent is created and passed as the only parameter to the function used to define the child. The parent object is how the child interacts with its parent. PROCESS MANAGEMENT METHODS @procs = Child->all_procs() Get a list of all the processes that have been started. This list is cleared in processes when they are started; that is a child will not list its siblings. @pids = Child->all_proc_pids() Get a list of all the pids of processes that have been started. Child->wait_all() Call wait() on all processes. EXPORTS $proc = child( sub { ... } ) $proc = child { ... } $proc = child( sub { ... }, $plugin, @data ) $proc = child { ... } $plugin => @data Create and start a process in one action. CONSTRUCTOR $child = Child->new( sub { ... } ) $child = Child->new( sub { ... }, $plugin, @plugin_data ) Create a new Child object. Does not start the child. OBJECT METHODS $proc = $child->start() Start the child process. SEE ALSO Child::Link::Proc The proc object that is returned by $child->start() Child::Link::Parent The parent object that is provided as the argument to the function used to define the child. Child::Link::IPC The base class for IPC plugin link objects. This provides the IPC methods. HISTORY Most of this was part of Parallel::Runner intended for use in the Fennec project. Fennec is being broken into multiple parts, this is one such part. FENNEC PROJECT This module is part of the Fennec project. See Fennec for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greater framework. Such tools are turned into their own projects. This is one such project. Fennec - The core framework The primary Fennec project that ties them all together. AUTHORS Chad Granum exodist7@gmail.com COPYRIGHT Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. LICENSE100644001750001750 4365212732526351 14207 0ustar00exodistexodist000000000000Child-0.013This software is copyright (c) 2016 by Chad Granum. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2016 by Chad Granum. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2016 by Chad Granum. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Changes100644001750001750 63612732526351 14430 0ustar00exodistexodist000000000000Child-0.0130.013 2016-06-22 08:21:12-07:00 America/Los_Angeles - Fix Windows (schwern) 0.012 2015-06-29 22:50:18-07:00 America/Los_Angeles - Switch to Dist::Zilla - Switch to new Changes Layout - Fix destructor bug (#12) 0.011 - Clean up child processes once they are have been waited on, do not store them forever ? - Processes created by fork will have negative pids on Windows (CHORNY) t000755001750001750 012732526351 13253 5ustar00exodistexodist000000000000Child-0.013die.t100644001750001750 220512732526351 14340 0ustar00exodistexodist000000000000Child-0.013/t#!/usr/bin/perl; use strict; use warnings; use Test::More 0.88; use Capture::Tiny qw(capture_stderr); our $CLASS = 'Child'; require_ok( $CLASS ); note "die in child"; { my $pid = $$; is capture_stderr { my $child = Child->new(sub { die "Foo\n" }); my $proc = $child->start; $proc->wait; is $proc->exit_status, 255; }, "Foo\n"; is $pid, $$, "didn't leak out of the child process"; } note "Child in eval"; { my $pid = $$; is capture_stderr { eval { my $child = Child->new(sub { die "Foo\n" }); my $proc = $child->start; $proc->wait; is $proc->exit_status, 255; }; is $@, '', "child death does not affect parent \$@"; }, "Foo\n"; is $pid, $$, "didn't leak out of the child process"; }; note "Function returning false isn't confused with dying"; { my $pid = $$; is capture_stderr { my $child = Child->new(sub { return }); my $proc = $child->start; $proc->wait; is $proc->exit_status, 0; }, ""; is $pid, $$, "didn't leak out of the child process"; }; done_testing; MANIFEST100644001750001750 67712732526351 14273 0ustar00exodistexodist000000000000Child-0.013# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.047. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README cpanfile lib/Child.pm lib/Child/IPC/Pipe.pm lib/Child/Link.pm lib/Child/Link/IPC.pm lib/Child/Link/IPC/Pipe.pm lib/Child/Link/IPC/Pipe/Parent.pm lib/Child/Link/IPC/Pipe/Proc.pm lib/Child/Link/Parent.pm lib/Child/Link/Proc.pm lib/Child/Util.pm t/Child.t t/Clean_all_procs.t t/Import.t t/Manage.t t/die.t cpanfile100644001750001750 46512732526351 14641 0ustar00exodistexodist000000000000Child-0.013requires "Exporter" => "5.57"; requires "POSIX" => "0"; requires "perl" => "5.006"; on 'test' => sub { requires "Capture::Tiny" => "0.31"; requires "Test::More" => "0.88"; }; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "0"; }; on 'develop' => sub { requires "Test::Pod" => "1.41"; }; META.yml100644001750001750 114612732526351 14423 0ustar00exodistexodist000000000000Child-0.013--- abstract: 'Object oriented simple interface to fork()' author: - 'Chad Granum ' build_requires: Capture::Tiny: '0.31' Test::More: '0.88' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 5.047, CPAN::Meta::Converter version 2.150001' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Child requires: Exporter: '5.57' POSIX: '0' perl: '5.006' resources: bugtracker: http://github.com/exodist/Child/issues repository: http://github.com/exodist/Child version: '0.013' Child.t100644001750001750 435512732526351 14632 0ustar00exodistexodist000000000000Child-0.013/t#!/usr/bin/perl; use strict; use warnings; use Test::More 0.88; our $CLASS = 'Child'; require_ok( $CLASS ); my $child = $CLASS->new( sub { my $self = shift; $self->say( "Have self" ); $self->say( "parent: " . $self->pid ); my $in = $self->read(); $self->say( $in ); }, pipe => 1 ); my $proc = $child->start; is( $proc->read(), "Have self\n", "child has self" ); is( $proc->read(), "parent: $$\n", "child has parent PID" ); { local $SIG{ALRM} = sub { die "non-blocking timeout" }; alarm 5; ok( !$proc->is_complete, "Not Complete" ); alarm 0; } $proc->say("XXX"); is( $proc->read(), "XXX\n", "Full IPC" ); ok( $proc->wait, "wait" ); ok( $proc->is_complete, "Complete" ); is( $proc->exit_status, 0, "Exit clean" ); $proc = $CLASS->new( sub { sleep 15 } )->start; my $ret = eval { $proc->say("XXX"); 1 }; ok( !$ret, "Died, no IPC" ); like( $@, qr/Child was created without IPC support./, "No IPC" ); if ( $^O eq 'MSWin32' ) { diag( "on win32 we must wait on this process (15 seconds)" ); $proc->wait; } else { $proc->kill(2); } $proc = $CLASS->new( sub { my $self = shift; $SIG{INT} = sub { exit( 2 ) }; $self->say( "go" ); sleep 15; exit 2; }, pipe => 1 )->start; $proc->read; sleep 1; if ( $^O eq 'MSWin32' ) { diag( "on win32 we must wait on this process (15 seconds)" ); $proc->wait; } else { ok( $proc->kill(2), "Send signal" ); ok( !$proc->wait, "wait" ); } ok( $proc->is_complete, "Complete" ); is( $proc->exit_status, 2, "Exit 2" ); ok( $proc->unix_exit > 2, "Real exit" ); $child = $CLASS->new( sub { my $self = shift; $self->autoflush(0); $self->say( "A" ); $self->flush; $self->say( "B" ); sleep 5; $self->flush; }, pipe => 1 ); $proc = $child->start; is( $proc->read(), "A\n", "A" ); my $start = time; is( $proc->read(), "B\n", "B" ); my $end = time; ok( $end - $start > 2, "No autoflush" ); SKIP: { if ($^O eq 'MSWin32') { skip "detach is not available on win32", 1; } else { $proc = $CLASS->new( sub { my $self = shift; $self->detach; $self->say( $self->detached ); }, pipe => 1 )->start; is( $proc->read(), $proc->pid . "\n", "Child detached" ); } } done_testing; META.json100644001750001750 225712732526351 14577 0ustar00exodistexodist000000000000Child-0.013{ "abstract" : "Object oriented simple interface to fork()", "author" : [ "Chad Granum " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.047, CPAN::Meta::Converter version 2.150001", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Child", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Test::Pod" : "1.41" } }, "runtime" : { "requires" : { "Exporter" : "5.57", "POSIX" : "0", "perl" : "5.006" } }, "test" : { "requires" : { "Capture::Tiny" : "0.31", "Test::More" : "0.88" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "http://github.com/exodist/Child/issues" }, "repository" : { "type" : "git", "url" : "http://github.com/exodist/Child" } }, "version" : "0.013" } Manage.t100644001750001750 114612732526351 14772 0ustar00exodistexodist000000000000Child-0.013/t#!/usr/bin/perl; use strict; use warnings; use Test::More 0.88; our $CLASS = 'Child'; require_ok( $CLASS ); my @children = map { $CLASS->new(sub { 1 }) } 1 .. 4; my @get = $CLASS->all_procs; is( @get, 0, "0 children started" ); my @all; push @all => $_->start for @children; @get = $CLASS->all_procs; is( @get, 4, "4 children" ); is_deeply( \@get, \@all, "Exact list" ); is_deeply( [ $CLASS->all_proc_pids ], [ map { $_->pid } @all ], "pids" ); is( $_->exit(), undef, "Not waited " . $_->pid ) for @all; $CLASS->wait_all(); ok( defined($_->exit()), "waited " . $_->pid ) for @all; done_testing; Import.t100644001750001750 62012732526351 15030 0ustar00exodistexodist000000000000Child-0.013/t#!/usr/bin/perl; use strict; use warnings; use Test::More 0.88; our $CLASS = 'Child'; require_ok( $CLASS ); $CLASS->import(); ok( ! __PACKAGE__->can('child'), "No export by default" ); $CLASS->import('child'); can_ok( __PACKAGE__, 'child' ); my $one = child( sub { 1 }); ok( !$one->ipc, "no ipc by default" ); $one = child( sub { 1 }, pipe => 1 ); ok( $one->ipc, "ipc by param" ); done_testing; Makefile.PL100644001750001750 216112732526351 15122 0ustar00exodistexodist000000000000Child-0.013# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.047. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Object oriented simple interface to fork()", "AUTHOR" => "Chad Granum ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Child", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.006", "NAME" => "Child", "PREREQ_PM" => { "Exporter" => "5.57", "POSIX" => 0 }, "TEST_REQUIRES" => { "Capture::Tiny" => "0.31", "Test::More" => "0.88" }, "VERSION" => "0.013", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Capture::Tiny" => "0.31", "Exporter" => "5.57", "POSIX" => 0, "Test::More" => "0.88" ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); lib000755001750001750 012732526351 13556 5ustar00exodistexodist000000000000Child-0.013Child.pm100644001750001750 1474112732526351 15326 0ustar00exodistexodist000000000000Child-0.013/libpackage Child; use 5.006; use strict; use warnings; use Carp; use Child::Util; use Child::Link::Proc; use Child::Link::Parent; use Exporter 'import'; our $VERSION = "0.013"; our @PROCS; our @EXPORT_OK = qw/child/; add_accessors qw/code/; sub child(&;@) { my ( $code, @params ) = @_; my $caller = caller; return __PACKAGE__->new( $code, @params )->start; } sub all_procs { @PROCS } sub _clean_proc { my $class = shift; my ($proc) = @_; return unless $proc; return unless @PROCS; @PROCS = grep { $_ && $proc != $_ } @PROCS; } sub all_proc_pids { my $class = shift; map { $_->pid } $class->all_procs; } sub wait_all { my $class = shift; $_->wait() for $class->all_procs; } sub new { my ( $class, $code, $plugin, @data ) = @_; return bless( { _code => $code }, $class ) unless $plugin; my $build = __PACKAGE__; $build .= '::IPC::' . ucfirst $plugin; eval "require $build; 1" || croak( "Could not load plugin '$plugin': $@" ); return $build->new( $code, @data ); } sub shared_data {} sub child_class { 'Child::Link::Proc' } sub parent_class { 'Child::Link::Parent' } sub start { my $self = shift; my $ppid = $$; my @data = $self->shared_data; if ( my $pid = fork() ) { my $proc = $self->child_class->new( $pid, @data ); push @PROCS => $proc; return $proc; } # In the child @PROCS = (); my $parent = $self->parent_class->new( $ppid, @data ); my $code = $self->code; # Ensure the child code can't die and jump out of our control. eval { $code->( $parent ); 1; } || do { # Simulate die without dying. print STDERR $@; exit 255; }; exit; } 1; __END__ =head1 NAME Child - Object oriented simple interface to fork() =head1 DESCRIPTION Fork is too low level, and difficult to manage. Often people forget to exit at the end, reap their children, and check exit status. The problem is the low level functions provided to do these things. Throw in pipes for IPC and you just have a pile of things nobody wants to think about. Child is an Object Oriented interface to fork. It provides a clean way to start a child process, and manage it afterwords. It provides methods for running, waiting, killing, checking, and even communicating with a child process. B: kill() is unpredictable on windows, strawberry perl sends the kill signal to the parent as well as the child. =head1 SYNOPSIS =head2 BASIC use Child; my $child = Child->new(sub { my ( $parent ) = @_; .... # exit() is called for you at the end. }); my $proc = $child->start; # Kill the child if it is not done $proc->is_complete || $proc->kill(9); $proc->wait; #blocking =head2 IPC # Build with IPC my $child2 = Child->new(sub { my $self = shift; $self->say("message1"); $self->say("message2"); my $reply = $self->read(1); }, pipe => 1 ); my $proc2 = $child2->start; # Read (blocking) my $message1 = $proc2->read(); my $message2 = $proc2->read(); $proc2->say("reply"); =head2 SHORTCUT Child can export the child() shortcut function when requested. This function creates and starts the child process in one action. use Child qw/child/; my $proc = child { my $parent = shift; ... }; You can also request IPC: use Child qw/child/; my $child = child { my $parent = shift; ... } pipe => 1; =head1 DETAILS First you define a child, you do this by constructing a L object. Defining a child does not start a new process, it is just the way to define what the new process will look like. Once you have defined the child you can start the process by calling $child->start(). One child object can start as many processes as you like. When you start a child an L object is returned. This object provides multiple useful methods for interacting with your process. Within the process itself an L is created and passed as the only parameter to the function used to define the child. The parent object is how the child interacts with its parent. =head1 PROCESS MANAGEMENT METHODS =over 4 =item @procs = Child->all_procs() Get a list of all the processes that have been started. This list is cleared in processes when they are started; that is a child will not list its siblings. =item @pids = Child->all_proc_pids() Get a list of all the pids of processes that have been started. =item Child->wait_all() Call wait() on all processes. =back =head1 EXPORTS =over 4 =item $proc = child( sub { ... } ) =item $proc = child { ... } =item $proc = child( sub { ... }, $plugin, @data ) =item $proc = child { ... } $plugin => @data Create and start a process in one action. =back =head1 CONSTRUCTOR =over 4 =item $child = Child->new( sub { ... } ) =item $child = Child->new( sub { ... }, $plugin, @plugin_data ) Create a new Child object. Does not start the child. =back =head1 OBJECT METHODS =over =item $proc = $child->start() Start the child process. =back =head1 SEE ALSO =over 4 =item L The proc object that is returned by $child->start() =item L The parent object that is provided as the argument to the function used to define the child. =item L The base class for IPC plugin link objects. This provides the IPC methods. =back =head1 HISTORY Most of this was part of L intended for use in the L project. Fennec is being broken into multiple parts, this is one such part. =head1 FENNEC PROJECT This module is part of the Fennec project. See L for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greater framework. Such tools are turned into their own projects. This is one such project. =over 2 =item L - The core framework The primary Fennec project that ties them all together. =back =head1 AUTHORS Chad Granum L =head1 COPYRIGHT Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. Child000755001750001750 012732526351 14601 5ustar00exodistexodist000000000000Child-0.013/libLink.pm100644001750001750 313012732526351 16171 0ustar00exodistexodist000000000000Child-0.013/lib/Childpackage Child::Link; use strict; use warnings; use Child::Util; use Carp qw/croak/; add_accessors qw/pid/; sub ipc { undef } sub _no_ipc { croak "Child was created without IPC support" } sub new { my $class = shift; my ( $pid ) = @_; return bless( { _pid => $pid }, $class ); } { no strict 'refs'; *{__PACKAGE__ . '::' . $_} = \&_no_ipc for qw/autoflush flush read say write/; } 1; =head1 NAME Child::Link - Base class for objects that link child and parent processes. =head1 HISTORY Most of this was part of L intended for use in the L project. Fennec is being broken into multiple parts, this is one such part. =head1 FENNEC PROJECT This module is part of the Fennec project. See L for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greater framework. Such tools are turned into their own projects. This is one such project. =over 2 =item L - The core framework The primary Fennec project that ties them all together. =back =head1 AUTHORS Chad Granum L =head1 COPYRIGHT Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. Util.pm100644001750001750 372012732526351 16216 0ustar00exodistexodist000000000000Child-0.013/lib/Childpackage Child::Util; use strict; use warnings; use Carp qw/croak/; use Exporter 'import'; our @EXPORT = qw/add_accessors add_abstract/; sub _abstract { my $class = shift; croak "$class does not implement this function." } sub add_abstract { my $caller = caller; no strict 'refs'; *{"$caller\::$_"} = \&_abstract for @_; } sub add_accessors { my $class = caller; _add_accessor( $class, $_ ) for @_; } sub _add_accessor { my ( $class, $reader ) = @_; my $prop = "_$reader"; my $psub = sub { my $self = shift; ($self->{ $prop }) = @_ if @_; return $self->{ $prop }; }; my $rsub = sub { my $self = shift; return $self->$prop(); }; no strict 'refs'; *{"$class\::$reader"} = $rsub; *{"$class\::$prop"} = $psub; } 1; =head1 NAME Child::Util - Utility functions for L>Child> =head1 HISTORY Most of this was part of L intended for use in the L project. Fennec is being broken into multiple parts, this is one such part. =head1 FENNEC PROJECT This module is part of the Fennec project. See L for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greater framework. Such tools are turned into their own projects. This is one such project. =over 2 =item L - The core framework The primary Fennec project that ties them all together. =back =head1 AUTHORS Chad Granum L =head1 COPYRIGHT Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. Clean_all_procs.t100644001750001750 161012732526351 16656 0ustar00exodistexodist000000000000Child-0.013/t#!/usr/bin/perl; use strict; use warnings; use Test::More 0.88; our $CLASS = 'Child'; require_ok( $CLASS ); my $spec = $CLASS->new( sub { my $self = shift; my $in = $self->read(); }, pipe => 1 ); my $child1 = $spec->start; my $child2 = $spec->start; sleep 1; $child1->is_complete; $child2->is_complete; ok((grep {$child1 == $_} $CLASS->all_procs), "Found child 1, still active"); ok((grep {$child2 == $_} $CLASS->all_procs), "Found child 2, still active"); $child1->say("anything"); sleep 1; $child1->is_complete; $child2->is_complete; ok(!(grep {$child1 == $_} $CLASS->all_procs), "child 1 not found"); ok((grep {$child2 == $_} $CLASS->all_procs), "Found child 2, still active"); $child2->say("anything"); sleep 1; Child->wait_all; ok(!(grep {$child1 == $_} $CLASS->all_procs), "child 1 not found"); ok(!(grep {$child2 == $_} $CLASS->all_procs), "child 2 not found"); done_testing; Link000755001750001750 012732526351 15476 5ustar00exodistexodist000000000000Child-0.013/lib/ChildIPC.pm100644001750001750 615312732526351 16614 0ustar00exodistexodist000000000000Child-0.013/lib/Child/Linkpackage Child::Link::IPC; use strict; use warnings; use Child::Util; use base 'Child::Link'; add_accessors qw/ipc/; add_abstract qw/ read_handle write_handle /; sub init {} sub new { my $class = shift; my ( $pid, @shared ) = @_; my $self = $class->SUPER::new($pid); $self->init( @shared ); return $self; } sub autoflush { my $self = shift; my ( $value ) = @_; my $write = $self->write_handle; my $selected = select( $write ); $| = $value if @_; my $out = $|; select( $selected ); return $out; } sub flush { my $self = shift; my $orig = $self->autoflush(); $self->autoflush(1); my $write = $self->write_handle; $self->autoflush($orig); } sub read { my $self = shift; my $handle = $self->read_handle; return <$handle>; } sub say { my $self = shift; $self->write( map {$_ . $/} @_ ); } sub write { my $self = shift; my $handle = $self->write_handle; print $handle @_; } 1; =head1 NAME Child::Link::IPC - Base class for process links that provide IPC. =head1 SEE ALSO This class inherits from: =over 4 =item L =back =head1 METHODS =over 4 =item $proc->new( $pid. @shared ) Constructor =item $proc->read() Read a message from the child. =item $proc->write( @MESSAGES ) Send the messages to the child. works like print, you must add "\n". =item $proc->say( @MESSAGES ) Send the messages to the child. works like say, adds the separator for you (usually "\n"). =item $proc->autoflush( $BOOL ) Turn autoflush on/off for the current processes write handle. This is on by default. =item $proc->flush() Flush the current processes write handle. =item $proc->ipc() =item $proc->_ipc( $new ) Accessors for you to use or ignore. =back =head1 ABSTRACT METHODS =over 4 =item $proc->read_handle() Should return a read handle for reading from the child. =item $proc->write_handle() Should return a write handle for writing to the child. =item $proc->init( @shared ) Called by new during construction =back =head1 HISTORY Most of this was part of L intended for use in the L project. Fennec is being broken into multiple parts, this is one such part. =head1 FENNEC PROJECT This module is part of the Fennec project. See L for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greater framework. Such tools are turned into their own projects. This is one such project. =over 2 =item L - The core framework The primary Fennec project that ties them all together. =back =head1 AUTHORS Chad Granum L =head1 COPYRIGHT Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. IPC000755001750001750 012732526351 15214 5ustar00exodistexodist000000000000Child-0.013/lib/ChildPipe.pm100644001750001750 332012732526351 16605 0ustar00exodistexodist000000000000Child-0.013/lib/Child/IPCpackage Child::IPC::Pipe; use strict; use warnings; use Child::Link::IPC::Pipe::Proc; use Child::Link::IPC::Pipe::Parent; use base 'Child'; sub child_class { 'Child::Link::IPC::Pipe::Proc' } sub parent_class { 'Child::Link::IPC::Pipe::Parent' } sub shared_data { pipe( my ( $ain, $aout )); pipe( my ( $bin, $bout )); return [ [ $ain, $aout ], [ $bin, $bout ], ]; } sub new { my ( $class, $code ) = @_; return bless( { _code => $code }, $class ); } 1; =head1 NAME Child::IPC::Pipe - Pipe based IPC plugin for L =head1 DESCRIPTION Creates 2 pipes just before forking. =head1 HISTORY Most of this was part of L intended for use in the L project. Fennec is being broken into multiple parts, this is one such part. =head1 FENNEC PROJECT This module is part of the Fennec project. See L for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greater framework. Such tools are turned into their own projects. This is one such project. =over 2 =item L - The core framework The primary Fennec project that ties them all together. =back =head1 AUTHORS Chad Granum L =head1 COPYRIGHT Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. Proc.pm100644001750001750 741012732526351 17101 0ustar00exodistexodist000000000000Child-0.013/lib/Child/Linkpackage Child::Link::Proc; use strict; use warnings; use Carp; use Carp; use Child::Util; use base 'Child::Link'; add_accessors qw/exit/; sub is_complete { my $self = shift; $self->_wait(); return defined($self->exit); } sub wait { my $self = shift; return unless $self->_wait(1); return !$self->exit; } sub exit_status { my $self = shift; return unless $self->is_complete; return ($self->exit >> 8); } sub unix_exit { my $self = shift; return unless $self->is_complete; return $self->exit; } sub _wait { my $self = shift; my ( $block ) = @_; #non-blocking to check if process was terminated #blocking to wait until it finishes unless ( defined $self->exit ) { my @flags; require POSIX unless $block; my $ret; my $x = 1; do { sleep(1) if defined $ret; $ret = waitpid( $self->pid, $block ? 0 : &POSIX::WNOHANG ); } while ( $block && !$ret ); return 0 unless $ret; if ($^O eq 'MSWin32') { croak( "wait returned $ret: No such process " . $self->pid ) if $ret == -1; #forked threads on Win32 have negative pids } else { croak( "wait returned $ret: No such process " . $self->pid ) if $ret < 0; } Child->_clean_proc($self); $self->_exit( $? ); } return defined($self->exit); } sub kill { my $self = shift; my ( $sig ) = @_; kill( $sig, $self->pid ); } 1; =head1 NAME Child::Link::Proc - Proc object used by L. =head1 SEE ALSO This class inherits from: =over 4 =item L =back =head1 METHODS =over 4 =item $bool = $proc->is_complete() Check if the child is finished (non-blocking) =item $proc->wait() Wait until child terminates, destroy remaining zombie process (blocking) =item $proc->kill($SIG) Send the $SIG signal to the child process. B: kill() is unpredictable on windows, strawberry perl sends the kill signal to the parent as well as the child. =item $proc->pid() Returns the process PID. =item $proc->exit_status() Will be undef unless the process has exited, otherwise it will have the exit status. B: When you call exit($N) the actual unix exit status will be bit shifted with extra information added. exit_status() will shift the value back for you. That means exit_status() will return 2 when your child calls exit(2) see unix_exit() if you want the actual value wait() assigned to $?. =item $proc->unix_exit() When you call exit($N) the actual unix exit status will be bit shifted with extra information added. See exit_status() if you want the actual value used in exit() in the child. =back =head1 HISTORY Most of this was part of L intended for use in the L project. Fennec is being broken into multiple parts, this is one such part. =head1 FENNEC PROJECT This module is part of the Fennec project. See L for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greater framework. Such tools are turned into their own projects. This is one such project. =over 2 =item L - The core framework The primary Fennec project that ties them all together. =back =head1 AUTHORS Chad Granum L =head1 COPYRIGHT Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. Parent.pm100644001750001750 327412732526351 17433 0ustar00exodistexodist000000000000Child-0.013/lib/Child/Linkpackage Child::Link::Parent; use strict; use warnings; use Child::Util; use base 'Child::Link'; add_accessors qw/detached/; sub detach { my $self = shift; require POSIX; $self->_detached( POSIX::setsid() ) || die "Cannot detach from parent $!"; } 1; =head1 NAME Child::Link::Proc - Proc object used by L. =head1 SEE ALSO This class inherits from: =over 4 =item L =back =head1 METHODS =over 4 =item $proc->pid() Returns the parent process PID. =item $proc->detach() Detach the from the parent. uses POSIX::setsid(). Not available in windows. =back =head1 HISTORY Most of this was part of L intended for use in the L project. Fennec is being broken into multiple parts, this is one such part. =head1 FENNEC PROJECT This module is part of the Fennec project. See L for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greater framework. Such tools are turned into their own projects. This is one such project. =over 2 =item L - The core framework The primary Fennec project that ties them all together. =back =head1 AUTHORS Chad Granum L =head1 COPYRIGHT Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. IPC000755001750001750 012732526351 16111 5ustar00exodistexodist000000000000Child-0.013/lib/Child/LinkPipe.pm100644001750001750 336112732526351 17507 0ustar00exodistexodist000000000000Child-0.013/lib/Child/Link/IPCpackage Child::Link::IPC::Pipe; use strict; use warnings; use Child::Util; use base 'Child::Link::IPC'; add_abstract qw/cross_pipes/; sub read_handle { shift->ipc->[0] } sub write_handle { shift->ipc->[1] } sub init { my $self = shift; my ($pipes) = @_; $pipes = [ $pipes->[1], $pipes->[0], ] if $self->cross_pipes; $self->_ipc([ $pipes->[0]->[0], $pipes->[1]->[1], ]); $self->autoflush(1); } 1; =head1 NAME Child::Link::IPC::Pipe - Base class for link objects used by the L plugin. =head1 SEE ALSO This class inherits from: =over 4 =item L =back =head1 HISTORY Most of this was part of L intended for use in the L project. Fennec is being broken into multiple parts, this is one such part. =head1 FENNEC PROJECT This module is part of the Fennec project. See L for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greater framework. Such tools are turned into their own projects. This is one such project. =over 2 =item L - The core framework The primary Fennec project that ties them all together. =back =head1 AUTHORS Chad Granum L =head1 COPYRIGHT Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. Pipe000755001750001750 012732526351 17006 5ustar00exodistexodist000000000000Child-0.013/lib/Child/Link/IPCProc.pm100644001750001750 276412732526351 20420 0ustar00exodistexodist000000000000Child-0.013/lib/Child/Link/IPC/Pipepackage Child::Link::IPC::Pipe::Proc; use strict; use warnings; use Child::Util; use base qw/ Child::Link::IPC::Pipe Child::Link::Proc /; sub cross_pipes { 0 }; 1; =head1 NAME Child::Link::IPC::Pipe::Proc - Proc object used by the pipe plugin. =head1 SEE ALSO This class inherits from: =over 4 =item L =item L =item L =back =head1 HISTORY Most of this was part of L intended for use in the L project. Fennec is being broken into multiple parts, this is one such part. =head1 FENNEC PROJECT This module is part of the Fennec project. See L for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greater framework. Such tools are turned into their own projects. This is one such project. =over 2 =item L - The core framework The primary Fennec project that ties them all together. =back =head1 AUTHORS Chad Granum L =head1 COPYRIGHT Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. Parent.pm100644001750001750 277612732526351 20751 0ustar00exodistexodist000000000000Child-0.013/lib/Child/Link/IPC/Pipepackage Child::Link::IPC::Pipe::Parent; use strict; use warnings; use Child::Util; use base qw/ Child::Link::IPC::Pipe Child::Link::Parent /; sub cross_pipes { 1 }; 1; =head1 NAME Child::Link::IPC::Pipe::Parent - Parent object used by the pipe plugin. =head1 SEE ALSO This class inherits from: =over 4 =item L =item L =item L =back =head1 HISTORY Most of this was part of L intended for use in the L project. Fennec is being broken into multiple parts, this is one such part. =head1 FENNEC PROJECT This module is part of the Fennec project. See L for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greater framework. Such tools are turned into their own projects. This is one such project. =over 2 =item L - The core framework The primary Fennec project that ties them all together. =back =head1 AUTHORS Chad Granum L =head1 COPYRIGHT Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.