Process::Infinite - Base class for processes that do not naturally end
Process::Infinite is a base class for Process objects that will not naturally finish without provocation from outside the process.
Process::Infinite
Examples of this are system "daemons" and servers of various types.
At the present time this class is purely indicative. It contains no additional functionality.
When writing a Process::Infinite class, the most important thing to note is how you plan to shutdown your process. This will vary from case to case but the general implementation tends to be the same.
Your run class consists of a main loop. How often this loop will fire will vary, but it should generally fire at least once a second or so.
run
The loop will check a flag or do some other cheap task to know if it is time to stop, then shutdown gracefully. You will then add some form of signal handler that sets the shutdown flag.
On UNIX platforms, you should at the very least add a signal handler for SIGTERM, as this is what will be sent to you by the operating system when it shuts down. (If you don't respond in a few seconds, it will then SIGKILL and take out your running process by force, with no chance for you to shut down gracefully)
SIGTERM
SIGKILL
Bugs should be reported via the CPAN bug tracker at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Process
For other issues, contact the author.
Adam Kennedy <adamk@cpan.org>
http://ali.as/
Copyright 2006 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install Process, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Process
CPAN shell
perl -MCPAN -e shell install Process
For more information on module installation, please visit the detailed CPAN module installation guide.