]> git.vpit.fr Git - perl/modules/IPC-MorseSignals.git/blob - README
Importing IPC-MorseSignals-0.01.tar.gz
[perl/modules/IPC-MorseSignals.git] / README
1 NAME
2     IPC::MorseSignals - Communicate between processes with Morse signals.
3
4 VERSION
5     Version 0.01
6
7 SYNOPSIS
8         use IPC::MorseSignals qw/msend mrecv/;
9
10         my $pid = fork;
11         if (!defined $pid) {
12          die "fork() failed: $!";
13         } elsif ($pid == 0) {
14          local @SIG{qw/USR1 USR2/} = mrecv sub { print STDERR "recieved $_[0]!\n" };
15          1 while 1;
16         }
17         msend "hello!\n" => $pid;
18         waitpid $pid, 0;
19
20 DESCRIPTION
21     This module implements a rare form of IPC by sending Morse-like signals
22     through "SIGUSR1" and "SIGUSR2". It uses both signals "SIGUSR1" and
23     "SIGUSR2", so you won't be able to keep them for something else when you
24     use this module.
25
26     But, seriously, use something else for your IPC. :)
27
28 FUNCTIONS
29   "msend"
30         msend $msg, $pid [, $speed ]
31
32     Sends the string $msg to the process $pid (or to all the processes @$pid
33     if $pid is an array ref) at $speed bits per second. Default speed is
34     1000, don't set it too low or the target will miss bits and the whole
35     message will be crippled.
36
37   "mrecv"
38         mrecv $callback
39
40     Takes as its sole argument the callback triggered when a complete
41     message is received, and returns two code references that should replace
42     SIGUSR1 and SIGUSR2 signal handlers. Basically, you want to use it like
43     this :
44
45         local @SIG{qw/USR1 USR2/} = mrecv sub { ... };
46
47 EXPORT
48     This module exports on request its two only functions, "msend" and
49     "mrecv".
50
51 DEPENDENCIES
52     POSIX (standard since perl 5) and Time::HiRes (standard since perl
53     5.7.3) are required.
54
55 SEE ALSO
56     perlipc for information about signals.
57
58     For truely useful IPC, search for shared memory, pipes and semaphores.
59
60 AUTHOR
61     Vincent Pit, "<perl at profvince.com>"
62
63     You can contact me by mail or on #perl @ FreeNode (Prof_Vince).
64
65 BUGS
66     Please report any bugs or feature requests to "bug-ipc-morsesignals at
67     rt.cpan.org", or through the web interface at
68     <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IPC-MorseSignals>. I
69     will be notified, and then you'll automatically be notified of progress
70     on your bug as I make changes.
71
72 SUPPORT
73     You can find documentation for this module with the perldoc command.
74
75         perldoc IPC::MorseSignals
76
77 ACKNOWLEDGEMENTS
78     Thanks for the inspiration, mofino ! I hope this module will fill all
79     your IPC needs. :)
80
81 COPYRIGHT & LICENSE
82     Copyright 2007 Vincent Pit, all rights reserved.
83
84     This program is free software; you can redistribute it and/or modify it
85     under the same terms as Perl itself.
86