X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FIPC-MorseSignals.git;a=blobdiff_plain;f=lib%2FIPC%2FMorseSignals%2FEmitter.pm;h=bb02ac8e7da60e63dbb453fa6980aa1561e24745;hp=a45735cabc97e55f619f55276f9355ecd52de47f;hb=90d2b0db8abb64d3c16d674091938f8c65e9caac;hpb=5fce18d9cd1111ef3703d93bef8baba2a7c8fa10 diff --git a/lib/IPC/MorseSignals/Emitter.pm b/lib/IPC/MorseSignals/Emitter.pm index a45735c..bb02ac8 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.11 +Version 0.12 =cut -our $VERSION = '0.11'; +our $VERSION = '0.12'; =head1 SYNOPSIS @@ -32,7 +32,7 @@ our $VERSION = '0.11'; =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 > >>