]> git.vpit.fr Git - perl/modules/IPC-MorseSignals.git/blob - lib/IPC/MorseSignals.pm
This is 0.17
[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.17
13
14 =cut
15
16 our $VERSION = '0.17';
17
18 =head1 WARNING
19
20 Due to the POSIX signals specification (which I wasn't aware of at the time I wrote this module), this module is by nature completely unreliable and will never work properly.
21 It is therefore B<deprecated>.
22 Please don't use it (if you were actually crazy enough to use it).
23
24 =head1 SYNOPSIS
25
26     # In the sender process
27     use IPC::MorseSignals::Emitter;
28
29     my $deuce = IPC::MorseSignals::Emitter->new(speed => 1024);
30     $deuce->post('HLAGH') for 1 .. 3;
31     $deuce->send($pid);
32
33     ...
34
35     # In the receiver process
36     use IPC::MorseSignals::Receiver;
37
38     local %SIG;
39     my $pants = IPC::MorseSignals::Receiver->new(\%SIG, done => sub {
40      print STDERR "GOT $_[1]\n";
41     });
42
43 =head1 DESCRIPTION
44
45 This module implements a rare form of IPC by sending Morse-like signals through C<SIGUSR1> and C<SIGUSR2>.
46 Both of those signals are used, so you won't be able to keep them for something else when you use this module.
47
48 =over 4
49
50 =item *
51
52 L<IPC::MorseSignals::Emitter> is a base class for emitters ;
53
54 =item *
55
56 L<IPC::MorseSignals::Receiver> is a base class for receivers.
57
58 =back
59
60 But, seriously, use something else for your IPC. :)
61
62 =head1 CAVEATS
63
64 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.
65 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.
66
67 =head1 DEPENDENCIES
68
69 You need the complete L<Bit::MorseSignals> distribution.
70
71 L<Carp> (standard since perl 5), L<POSIX> (idem) and L<Time::HiRes> (since perl 5.7.3) are also required.
72
73 =head1 SEE ALSO
74
75 L<IPC::MorseSignals::Emitter>, L<IPC::MorseSignals::Receiver>.
76
77 L<Bit::MorseSignals>, L<Bit::MorseSignals::Emitter>, L<Bit::MorseSignals::Receiver>.
78
79 L<perlipc> for information about signals in perl.
80
81 For truly useful IPC, search for shared memory, pipes and semaphores.
82
83 =head1 AUTHOR
84
85 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
86
87 You can contact me by mail or on C<irc.perl.org> (vincent).
88
89 =head1 BUGS
90
91 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>.
92 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
93
94 =head1 SUPPORT
95
96 You can find documentation for this module with the perldoc command.
97
98     perldoc IPC::MorseSignals
99
100 =head1 ACKNOWLEDGEMENTS
101
102 Thanks for the inspiration, mofino ! I hope this module will fill all your IPC needs. :)
103
104 =head1 COPYRIGHT & LICENSE
105
106 Copyright 2007,2008,2013,2017 Vincent Pit, all rights reserved.
107
108 This program is free software; you can redistribute it and/or modify it
109 under the same terms as Perl itself.
110
111 =cut
112
113 1; # End of IPC::MorseSignals