"Bazerka" reported this in irc.perl.org #poe with a test case. I
modified the test case to be self-contained (writes its own log), and am
attaching it here.
I'll verify your patch with the test case and release a new POE
distribution this weekend.
Thanks for the patch, and thanks Bazerka for the test case. :)
#! /usr/bin/env perl
use strict;
use warnings;
use IO::Handle;
use POE qw(Wheel::FollowTail);
my $tailfile = "/tmp/xferlog";
my $write;
POE::Session->create(
inline_states => {
_start => sub {
open $write, ">", $tailfile or die $!;
$write->autoflush(1);
$_[KERNEL]->yield("on_tick");
},
on_tick => sub {
print "write\n";
print $write "tick at ", scalar(localtime), "\n";
$_[KERNEL]->delay("on_tick" => 1);
},
}
);
POE::Session->create(
inline_states => {
_start => sub {
print "_start\n";
$_[HEAP]{tailor} = POE::Wheel::FollowTail->new(
Filename => $tailfile,
InputEvent => "got_log_line",
ResetEvent => "got_log_rollover",
PollInterval => 10,
);
},
got_log_line => sub {
print "got_log_line\n";
print scalar localtime(), " got_log_line: $_[ARG0]\n";
},
got_log_rollover => sub {
print "got_log_rollover\n";
print "Log rolled over.\n";
},
}
);
POE::Kernel->run();