X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote%2FMiniLoop.pm;h=07744f84f97e6846d0a57a5daee8225c14a7eac5;hb=15b847bbaf9afc1e8370481a29be9164399fde51;hp=463ca79515b4f572f8ad63084d4d6f8bc590b1df;hpb=37efeb68748dd589455d8ae58d39e74700abdd67;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote/MiniLoop.pm b/lib/Object/Remote/MiniLoop.pm index 463ca79..07744f8 100644 --- a/lib/Object/Remote/MiniLoop.pm +++ b/lib/Object/Remote/MiniLoop.pm @@ -2,9 +2,15 @@ package Object::Remote::MiniLoop; use IO::Select; use Time::HiRes qw(time); -use Object::Remote::Logging qw( :log :dlog ); +use Object::Remote::Logging qw( :log :dlog router ); use Moo; +BEGIN { + $SIG{PIPE} = sub { log_debug { "Got a PIPE signal" } }; + + router()->exclude_forwarding +} + # this is ro because we only actually set it using local in sub run has is_running => (is => 'ro', clearer => 'stop'); #maximum duration that select() will block - undef means indefinite, @@ -107,7 +113,7 @@ sub watch_time { sub unwatch_time { my ($self, $id) = @_; - log_debug { "Removing timer with id of '$id'" }; + log_trace { "Removing timer with id of '$id'" }; @$_ = grep !($_ eq $id), @$_ for $self->_timers; return; } @@ -140,8 +146,10 @@ sub loop_once { my $write_count = 0; my @c = caller; my $wait_time = $self->_next_timer_expires_delay; - log_trace { sprintf("Run loop: loop_once() has been invoked by $c[1]:$c[2] with read:%i write:%i select timeout:%s", - scalar(keys(%$read)), scalar(keys(%$write)), defined $wait_time ? $wait_time : 'indefinite' ) }; + log_trace { + sprintf("Run loop: loop_once() has been invoked by $c[1]:$c[2] with read:%i write:%i select timeout:%s", + scalar(keys(%$read)), scalar(keys(%$write)), defined $wait_time ? $wait_time : 'indefinite' ) + }; my ($readable, $writeable) = IO::Select->select( $self->_read_select, $self->_write_select, undef, $wait_time );