ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-Fork/Fork.pm
(Generate patch)

Comparing AnyEvent-Fork/Fork.pm (file contents):
Revision 1.43 by root, Thu Apr 18 10:47:48 2013 UTC vs.
Revision 1.44 by root, Thu Apr 18 10:49:59 2013 UTC

224 } 224 }
225 } 225 }
226 226
227=head2 use AnyEvent::Fork as a faster fork+exec 227=head2 use AnyEvent::Fork as a faster fork+exec
228 228
229This runs C</bin/echo hi>, with stdandard output redirected to /tmp/log 229This runs C</bin/echo hi>, with standard output redirected to F</tmp/log>
230and standard error redirected to the communications socket. It is usually 230and standard error redirected to the communications socket. It is usually
231faster than fork+exec, but still lets you prepare the environment. 231faster than fork+exec, but still lets you prepare the environment.
232 232
233 open my $output, ">/tmp/log" or die "$!"; 233 open my $output, ">/tmp/log" or die "$!";
234 234
595 $_[0][PID] 595 $_[0][PID]
596} 596}
597 597
598=item $proc = $proc->eval ($perlcode, @args) 598=item $proc = $proc->eval ($perlcode, @args)
599 599
600Evaluates the given C<$perlcode> as ... perl code, while setting C<@_> to 600Evaluates the given C<$perlcode> as ... Perl code, while setting C<@_> to
601the strings specified by C<@args>, in the "main" package. 601the strings specified by C<@args>, in the "main" package.
602 602
603This call is meant to do any custom initialisation that might be required 603This call is meant to do any custom initialisation that might be required
604(for example, the C<require> method uses it). It's not supposed to be used 604(for example, the C<require> method uses it). It's not supposed to be used
605to completely take over the process, use C<run> for that. 605to completely take over the process, use C<run> for that.
871initialising them, for example, by calling C<init Gtk2> manually. 871initialising them, for example, by calling C<init Gtk2> manually.
872 872
873=item exiting calls object destructors 873=item exiting calls object destructors
874 874
875This only applies to users of L<AnyEvent::Fork:Early> and 875This only applies to users of L<AnyEvent::Fork:Early> and
876L<AnyEvent::Fork::Template>, or when initialiasing code creates objects 876L<AnyEvent::Fork::Template>, or when initialising code creates objects
877that reference external resources. 877that reference external resources.
878 878
879When a process created by AnyEvent::Fork exits, it might do so by calling 879When a process created by AnyEvent::Fork exits, it might do so by calling
880exit, or simply letting perl reach the end of the program. At which point 880exit, or simply letting perl reach the end of the program. At which point
881Perl runs all destructors. 881Perl runs all destructors.
908 908
909=head1 SEE ALSO 909=head1 SEE ALSO
910 910
911L<AnyEvent::Fork::Early> (to avoid executing a perl interpreter), 911L<AnyEvent::Fork::Early> (to avoid executing a perl interpreter),
912L<AnyEvent::Fork::Template> (to create a process by forking the main 912L<AnyEvent::Fork::Template> (to create a process by forking the main
913program at a convenient time). 913program at a convenient time), L<AnyEvent::Fork::RPC> (for simple RPC to
914child processes).
914 915
915=head1 AUTHOR AND CONTACT INFORMATION 916=head1 AUTHOR AND CONTACT INFORMATION
916 917
917 Marc Lehmann <schmorp@schmorp.de> 918 Marc Lehmann <schmorp@schmorp.de>
918 http://software.schmorp.de/pkg/AnyEvent-Fork 919 http://software.schmorp.de/pkg/AnyEvent-Fork

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines