POE::Component::Supervisor::Handle::Proc - A supervisor child handle for a POSIXish process.
# created by POE::Component::Supervisor::Supervised::Proc
These objects manage a real UNIX process (signalling, monitoring) within a POE::Component::Supervisor.
In order to kill a child process first the child's standard input is closed, then the TERM signal is sent, and after a wait period the KILL signal is sent.
TERM
KILL
If the child has not died by the time the KILL loop times out then an error is thrown (this happens under weird OS scenarios and shouldn't happen normally).
The attributes until_term, until_kill and wait_for determine the durations of these loops.
until_term
until_kill
wait_for
Initially inputs will be closed. Then, after until_term seconds have passed the TERM sending loop will start, sending the TERM signal with an exponential backoff.
When until_kill seconds have passed, from the time of the stop method being called, the TERM loop will be stopped, and instead the KILL signal will be sent, also with an exponential backoff.
stop
From the time of the stop method being called the handle will wait for a maximum of wait_for seconds before giving up on the child process.
ANy of these attributes may be set to undef to disable their corresponding behaviors (suppress sending of a certain signal, or wait indefinitely).
undef
NOTE: All the attributes are generally passsed in by POE::Component::Supervisor::Supervised::Proc, the factory for this class.
They are documented here because that is where their behavior is defined.
POE::Component::Supervisor::Supervised::Proc will borrow all the attributes from this class that have an init_arg, and as such they should be passed to "new" in POE::Component::Supervisor::Supervised::Proc, while this class is never instantiated directly..
init_arg
The time to wait after closing inputs, and before sending the TERM signal. Defaults to one tenth of a second.
Set to undef to disable sending the TERM signal.
The time to wait after closing inputs, and before sending the KILL signal. Defaults to 10 seconds.
Set to undef to disable sending the KILL signal.
How long to keep sending exit signals for.
Defaults to
5 + ( $self->until_kill || $self->until_term || 0 )
Whether or not to call "stop" in POE::Kernel in the child program, before the callback. Only applies to code references.
This allows a nested POE kernel to be started in the forked environment without needing to exec a new program.
exec
Defaults to true.
Whether or not to call "run" in POE::Kernel in the child program, after the callback. Only applies to code references.
A coderef or an array ref. Passed as the Program parameter to the wheel, but may be wrapped depending on the values of enable_nested_poe and start_nested_poe if it's a code ref.
Program
enable_nested_poe
start_nested_poe
Required.
Additional parameters to pass to "new" in POE::Wheel::Run.
Callbacks to be fired when the corresponding POE::Wheel::Run events are handled.
This only affects the default event handlers, if you ovverride those by passing your own wheel_parameters these callbacks will never take effect.
wheel_parameters
The arguments are passed through as is, see POE::Wheel::Run for the details.
Not required.
Read only attribute containing the process ID.
After the process has exited these read only attributes are filled in with the exit information.
exited is the raw value of $?, and exit_code and exit_signal are the values of applying WEXITSTATUS and WTERMSIG to that value.
exited
$?
exit_code
exit_signal
WEXITSTATUS
WTERMSIG
See POSIX for details.
Changes the default value of the original MooseX::LogDispatch attribute to true.
Never called directly, but called by POE::Component::Supervisor::Supervised::Proc.
Stop the running process
Check whether or not the process is still running.
All POE events supported by this object are currently internal, and as such the session corresponding to this object provides no useful POE interface.
To install POE::Component::Supervisor, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Component::Supervisor
CPAN shell
perl -MCPAN -e shell install POE::Component::Supervisor
For more information on module installation, please visit the detailed CPAN module installation guide.