AnyEvent-Fork

 view release on metacpan or  search on metacpan

Fork.pm  view on Meta::CPAN

existence of the process - if the other process exits, you get a readable
event on it, because exiting the process closes the socket (if it didn't
create any children using fork).

=over 4

=item Compatibility to L<AnyEvent::Fork::Remote>

If you want to write code that works with both this module and
L<AnyEvent::Fork::Remote>, you need to write your code so that it assumes
there are two file handles for communications, which might not be unix
domain sockets. The C<run> function should start like this:

   sub run {
      my ($rfh, @args) = @_; # @args is your normal arguments
      my $wfh = fileno $rfh ? $rfh : *STDOUT;

      # now use $rfh for reading and $wfh for writing
   }

This checks whether the passed file handle is, in fact, the process

README  view on Meta::CPAN


        Even if not used otherwise, the socket can be a good indicator for
        the existence of the process - if the other process exits, you get a
        readable event on it, because exiting the process closes the socket
        (if it didn't create any children using fork).

        Compatibility to AnyEvent::Fork::Remote
            If you want to write code that works with both this module and
            AnyEvent::Fork::Remote, you need to write your code so that it
            assumes there are two file handles for communications, which
            might not be unix domain sockets. The "run" function should
            start like this:

               sub run {
                  my ($rfh, @args) = @_; # @args is your normal arguments
                  my $wfh = fileno $rfh ? $rfh : *STDOUT;

                  # now use $rfh for reading and $wfh for writing
               }

            This checks whether the passed file handle is, in fact, the



( run in 2.163 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )