[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:56:51 UTC 2013


The following commit has been merged in the master branch:
commit bdea2b55a77f028b4ff7e16dbefd9bd3df02d5f9
Author: Tomas Doran <bobtfish at bobtfish.net>
Date:   Sun Apr 22 14:58:55 2012 +0100

    Actually going to work

diff --git a/lib/Log/Stash/Input/FileTail.pm b/lib/Log/Stash/Input/FileTail.pm
index 49fa5cd..de2b065 100644
--- a/lib/Log/Stash/Input/FileTail.pm
+++ b/lib/Log/Stash/Input/FileTail.pm
@@ -2,6 +2,7 @@ package Log::Stash::Input::FileTail;
 use Moose;
 use AnyEvent;
 use Try::Tiny;
+use Scalar::Util qw/ weaken /;
 use namespace::autoclean;
 
 with 'Log::Stash::Role::Input';
@@ -26,6 +27,7 @@ has tailer_pid => (
 
 sub _build_tail_handle {
     my $self = shift;
+    weaken($self);
     my $r;
     my $child_pid = open($r, "-|", "tail", "-F", $self->filename)
        // die "can't fork: $!";
@@ -33,9 +35,8 @@ sub _build_tail_handle {
         fh => $r,
         poll => "r",
         cb => sub {
-            my $data = parse_from_line(scalar <$r>)
-                or return;
-            $self->on_read->($data);
+            my $input = scalar <$r>;
+            $self->output_to->consume($input);
         },
     );
 }

-- 
libmessage-passing-perl Debian packaging



More information about the Pkg-perl-cvs-commits mailing list