[SCM] libmessage-passing-perl Debian packaging branch, master, updated. debian/0.111-3-14-g44f6e88
Tomas Doran
bobtfish at bobtfish.net
Mon May 6 11:57:37 UTC 2013
The following commit has been merged in the master branch:
commit 987b7d4d5d43d55b3f25024c8723d3935c01a35a
Author: Tomas Doran <bobtfish at bobtfish.net>
Date: Sun Aug 19 10:03:47 2012 +0100
Fix file tailer to not go insane on EOF. RT#78851
diff --git a/Changes b/Changes
index 6f2f56e..3b5fd07 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+ - Fix Message::Passing::Input::FileTail to not die if the tail process
+ is killed for any reason. It is instead re-spawned.. RT#78851
+
0.100
- Port the dist to Moo, so that the core of Message::Passing
uses no XS code. Components can still be written using full
diff --git a/lib/Message/Passing/Input/FileTail.pm b/lib/Message/Passing/Input/FileTail.pm
index 58f24d9..4af8a32 100644
--- a/lib/Message/Passing/Input/FileTail.pm
+++ b/lib/Message/Passing/Input/FileTail.pm
@@ -3,6 +3,7 @@ use Moo;
use MooX::Types::MooseLike::Base qw/ Str Int /;
use AnyEvent;
use Scalar::Util qw/ weaken /;
+use POSIX ":sys_wait_h";
use namespace::clean -except => 'meta';
with 'Message::Passing::Role::Input';
@@ -17,12 +18,7 @@ has _tail_handle => (
is => 'ro',
lazy => 1,
builder => '_build_tail_handle',
-);
-
-has tailer_pid => (
- init_arg => undef,
- is => 'ro',
- writer => '_set_tailer_pid',
+ clearer => '_clear_tail_handle',
);
sub _build_tail_handle {
@@ -36,6 +32,15 @@ sub _build_tail_handle {
poll => "r",
cb => sub {
my $input = scalar <$r>;
+ if (!defined $input) {
+ $self->_clear_tail_handle;
+ my $i; $i = AnyEvent->idle(cb => sub {
+ undef $i;
+ close($r);
+ $self->_tail_handle;
+ });
+ return;
+ }
$self->output_to->consume($input);
},
);
@@ -66,10 +71,6 @@ Message::Passing::Input::FileTail - File tailing input
The filename of the file to tail.
-=head2 tailer_pid
-
-The PID of the C<< tail -F >> being run.
-
=head1 SEE ALSO
L<Message::Passing>
--
libmessage-passing-perl Debian packaging
More information about the Pkg-perl-cvs-commits
mailing list