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

Comparing cvsroot/AnyEvent-Fork/Fork.pm (file contents):
Revision 1.49 by root, Fri Apr 19 12:56:53 2013 UTC vs.
Revision 1.50 by root, Sat Apr 20 19:58:06 2013 UTC

435 # send string 435 # send string
436 my $len = syswrite $self->[FH], $self->[QUEUE][0]; 436 my $len = syswrite $self->[FH], $self->[QUEUE][0];
437 437
438 unless ($len) { 438 unless ($len) {
439 return if $! == Errno::EAGAIN || $! == Errno::EWOULDBLOCK; 439 return if $! == Errno::EAGAIN || $! == Errno::EWOULDBLOCK;
440 undef $self->[3]; 440 undef $self->[WW];
441 die "AnyEvent::Fork: command write failure: $!"; 441 die "AnyEvent::Fork: command write failure: $!";
442 } 442 }
443 443
444 substr $self->[QUEUE][0], 0, $len, ""; 444 substr $self->[QUEUE][0], 0, $len, "";
445 shift @{ $self->[QUEUE] } unless length $self->[QUEUE][0]; 445 shift @{ $self->[QUEUE] } unless length $self->[QUEUE][0];
774 774
775 $self->[CB] = $cb; 775 $self->[CB] = $cb;
776 $self->_cmd (r => $func); 776 $self->_cmd (r => $func);
777} 777}
778 778
779=item $proc->to_fh ($cb->($fh)) 779=item $proc->to_fh ($cb->($fh)) # EXPERIMENTAL, MIGHT BE REMOVED
780 780
781Flushes all commands out to the process and then calls the callback with 781Flushes all commands out to the process and then calls the callback with
782the communications socket. 782the communications socket.
783 783
784The process object becomes unusable on return from this function - any 784The process object becomes unusable on return from this function - any
800 $self->[CB]->($self->[FH]); 800 $self->[CB]->($self->[FH]);
801 @$self = (); 801 @$self = ();
802 } 802 }
803} 803}
804 804
805=item new_from_fh AnyEvent::Fork $fh 805=item new_from_fh AnyEvent::Fork $fh # EXPERIMENTAL, MIGHT BE REMOVED
806 806
807Takes a file handle originally rceeived by the C<to_fh> method and creates 807Takes a file handle originally rceeived by the C<to_fh> method and creates
808a new C<AnyEvent:Fork> object. The child process itself will not change in 808a new C<AnyEvent:Fork> object. The child process itself will not change in
809any way, i.e. it will keep all the modifications done to it before calling 809any way, i.e. it will keep all the modifications done to it before calling
810C<to_fh>. 810C<to_fh>.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines