… | |
… | |
559 | } |
559 | } |
560 | |
560 | |
561 | =item $pid = $proc->pid |
561 | =item $pid = $proc->pid |
562 | |
562 | |
563 | Returns the process id of the process I<iff it is a direct child of the |
563 | Returns the process id of the process I<iff it is a direct child of the |
564 | process> running AnyEvent::Fork, and C<undef> otherwise. |
564 | process running AnyEvent::Fork>, and C<undef> otherwise. |
565 | |
565 | |
566 | Normally, only processes created via C<< AnyEvent::Fork->new_exec >> and |
566 | Normally, only processes created via C<< AnyEvent::Fork->new_exec >> and |
567 | L<AnyEvent::Fork::Template> are direct children, and you are responsible |
567 | L<AnyEvent::Fork::Template> are direct children, and you are responsible |
568 | to clean up their zombies when they die. |
568 | to clean up their zombies when they die. |
569 | |
569 | |
… | |
… | |
587 | |
587 | |
588 | The code will usually be executed after this call returns, and there is no |
588 | The code will usually be executed after this call returns, and there is no |
589 | way to pass anything back to the calling process. Any evaluation errors |
589 | way to pass anything back to the calling process. Any evaluation errors |
590 | will be reported to stderr and cause the process to exit. |
590 | will be reported to stderr and cause the process to exit. |
591 | |
591 | |
592 | If you want to execute some code to take over the process (see the |
592 | If you want to execute some code (that isn't in a module) to take over the |
593 | "fork+exec" example in the SYNOPSIS), you should compile a function via |
593 | process, you should compile a function via C<eval> first, and then call |
594 | C<eval> first, and then call it via C<run>. This also gives you access to |
594 | it via C<run>. This also gives you access to any arguments passed via the |
595 | any arguments passed via the C<send_xxx> methods, such as file handles. |
595 | C<send_xxx> methods, such as file handles. See the L<use AnyEvent::Fork as |
|
|
596 | a faster fork+exec> example. |
596 | |
597 | |
597 | Returns the process object for easy chaining of method calls. |
598 | Returns the process object for easy chaining of method calls. |
598 | |
599 | |
599 | =cut |
600 | =cut |
600 | |
601 | |