]> git.vpit.fr Git - perl/modules/IPC-MorseSignals.git/blob - lib/IPC/MorseSignals.pm
Put each POD sentence on its own line
[perl/modules/IPC-MorseSignals.git] / lib / IPC / MorseSignals.pm
1 package IPC::MorseSignals;
2
3 use strict;
4 use warnings;
5
6 =head1 NAME
7
8 IPC::MorseSignals - Communicate between processes with Morse signals.
9
10 =head1 VERSION
11
12 Version 0.16
13
14 =cut
15
16 our $VERSION = '0.16';
17
18 =head1 SYNOPSIS
19
20     # In the sender process
21     use IPC::MorseSignals::Emitter;
22
23     my $deuce = IPC::MorseSignals::Emitter->new(speed => 1024);
24     $deuce->post('HLAGH') for 1 .. 3;
25     $deuce->send($pid);
26
27     ...
28
29     # In the receiver process
30     use IPC::MorseSignals::Receiver;
31
32     local %SIG;
33     my $pants = IPC::MorseSignals::Receiver->new(\%SIG, done => sub {
34      print STDERR "GOT $_[1]\n";
35     });
36
37 =head1 DESCRIPTION
38
39 This module implements a rare form of IPC by sending Morse-like signals through C<SIGUSR1> and C<SIGUSR2>.
40 Both of those signals are used, so you won't be able to keep them for something else when you use this module.
41
42 =over 4
43
44 =item *
45
46 L<IPC::MorseSignals::Emitter> is a base class for emitters ;
47
48 =item *
49
50 L<IPC::MorseSignals::Receiver> is a base class for receivers.
51
52 =back
53
54 But, seriously, use something else for your IPC. :)
55
56 =head1 CAVEATS
57
58 When the same signal is sent several times in a row to a process, the POSIX standard does not guarantee that the relevant signal handler will be called for each of the notifications.
59 This will result in malformed messages if the transfer speed is so high that the operating system does not have the time to call the signal handler for each bit.
60
61 =head1 DEPENDENCIES
62
63 You need the complete L<Bit::MorseSignals> distribution.
64
65 L<Carp> (standard since perl 5), L<POSIX> (idem) and L<Time::HiRes> (since perl 5.7.3) are also required.
66
67 =head1 SEE ALSO
68
69 L<IPC::MorseSignals::Emitter>, L<IPC::MorseSignals::Receiver>.
70
71 L<Bit::MorseSignals>, L<Bit::MorseSignals::Emitter>, L<Bit::MorseSignals::Receiver>.
72
73 L<perlipc> for information about signals in perl.
74
75 For truly useful IPC, search for shared memory, pipes and semaphores.
76
77 =head1 AUTHOR
78
79 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
80
81 You can contact me by mail or on C<irc.perl.org> (vincent).
82
83 =head1 BUGS
84
85 Please report any bugs or feature requests to C<bug-ipc-morsesignals at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IPC-MorseSignals>.
86 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
87
88 =head1 SUPPORT
89
90 You can find documentation for this module with the perldoc command.
91
92     perldoc IPC::MorseSignals
93
94 =head1 ACKNOWLEDGEMENTS
95
96 Thanks for the inspiration, mofino ! I hope this module will fill all your IPC needs. :)
97
98 =head1 COPYRIGHT & LICENSE
99
100 Copyright 2007,2008,2013 Vincent Pit, all rights reserved.
101
102 This program is free software; you can redistribute it and/or modify it
103 under the same terms as Perl itself.
104
105 =cut
106
107 1; # End of IPC::MorseSignals