Permalink
Browse files

Resolve a race condition that caused the last line of rapid input to …

…be delayed. Resolves rt.cpan.org ticket #63242.
  • Loading branch information...
1 parent e766708 commit 48d36620428fd2d40621cc2c5423a8d57d2d2737 @dmw397 dmw397 committed with Jan 27, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/POE/Wheel/FollowTail.pm
@@ -352,9 +352,13 @@ sub _generate_filehandle_timer {
if (defined(my $raw_input = $driver->get($$handle))) {
TRACE_POLL and warn "<poll> " . time . " raw input";
$filter->get_one_start($raw_input);
- foreach my $cooked_input (@{$filter->get_one()}) {
- TRACE_POLL and warn "<poll> " . time . " cooked input";
- $k->call($ses, $$event_input, $cooked_input, $unique_id);
+ while (1) {
+ my $next_rec = $filter->get_one();
+ last unless @$next_rec;
+ foreach my $cooked_input (@$next_rec) {
+ TRACE_POLL and warn "<poll> " . time . " cooked input";
+ $k->call($ses, $$event_input, $cooked_input, $unique_id);
+ }
}
# Clear the filehandle's EOF status, if any.

0 comments on commit 48d3662

Please sign in to comment.