X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FIPC-MorseSignals.git;a=blobdiff_plain;f=lib%2FIPC%2FMorseSignals%2FEmitter.pm;h=7e2dca0d27309590eaeba523138f201f7d6846c9;hp=99fa22fc338cfc82a59154d44a9f5620cf9fc7c3;hb=db7266fa5be4347aac1d32a994d6529c7b5a4afb;hpb=ddcc7c395d570f0ea20a8e9a242fcbfcc0e49522 diff --git a/lib/IPC/MorseSignals/Emitter.pm b/lib/IPC/MorseSignals/Emitter.pm index 99fa22f..7e2dca0 100644 --- a/lib/IPC/MorseSignals/Emitter.pm +++ b/lib/IPC/MorseSignals/Emitter.pm @@ -16,11 +16,11 @@ IPC::MorseSignals::Emitter - Base class for IPC::MorseSignals emitters. =head1 VERSION -Version 0.10 +Version 0.14 =cut -our $VERSION = '0.10'; +our $VERSION = '0.14'; =head1 SYNOPSIS @@ -32,7 +32,7 @@ our $VERSION = '0.10'; =head1 DESCRIPTION -This module sends messages processed by a L emitter to another process as C (for bits 0) and C (for 1) signals. +This module sends messages processed by an underlying L emitter to another process as a sequence of C (for bits 0) and C (for 1) signals. =cut @@ -78,13 +78,13 @@ sub send { return unless defined $dest; my @dests = grep $_ > 0, ref $dest eq 'ARRAY' ? map int, grep defined, @$dest : int $dest; + return unless @dests; while (defined(my $bit = $self->pop)) { my @sigs = (SIGUSR1, SIGUSR2); my $d = $self->{delay} * 1_000_000; $d -= usleep $d while $d > 0; kill $sigs[$bit] => @dests; } - return unless @dests; } =head2 C<< delay < $seconds > >>