… | |
… | |
325 | usually return the process object, so you can chain method calls. |
325 | usually return the process object, so you can chain method calls. |
326 | |
326 | |
327 | If a process object is destroyed before calling its C<run> method, then |
327 | If a process object is destroyed before calling its C<run> method, then |
328 | the process simply exits. After C<run> is called, all responsibility is |
328 | the process simply exits. After C<run> is called, all responsibility is |
329 | passed to the specified function. |
329 | passed to the specified function. |
|
|
330 | |
|
|
331 | As long as there is any outstanding work to be done, process objects |
|
|
332 | resist being destroyed, so there is no reason to store them unless you |
|
|
333 | need them later - configure and forget works just fine. |
330 | |
334 | |
331 | =over 4 |
335 | =over 4 |
332 | |
336 | |
333 | =cut |
337 | =cut |
334 | |
338 | |
… | |
… | |
449 | Create a new "empty" perl interpreter process and returns its process |
453 | Create a new "empty" perl interpreter process and returns its process |
450 | object for further manipulation. |
454 | object for further manipulation. |
451 | |
455 | |
452 | The new process is forked from a template process that is kept around |
456 | The new process is forked from a template process that is kept around |
453 | for this purpose. When it doesn't exist yet, it is created by a call to |
457 | for this purpose. When it doesn't exist yet, it is created by a call to |
454 | C<new_exec> and kept around for future calls. |
458 | C<new_exec> first and then stays around for future calls. |
455 | |
|
|
456 | When the process object is destroyed, it will release the file handle |
|
|
457 | that connects it with the new process. When the new process has not yet |
|
|
458 | called C<run>, then the process will exit. Otherwise, what happens depends |
|
|
459 | entirely on the code that is executed. |
|
|
460 | |
459 | |
461 | =cut |
460 | =cut |
462 | |
461 | |
463 | sub new { |
462 | sub new { |
464 | my $class = shift; |
463 | my $class = shift; |