| POE-Component-Supervisor documentation | view source | Contained in the POE-Component-Supervisor distribution. |
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.
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.
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.
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).
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..
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.
Defaults to true.
Whether or not to call run in POE::Kernel in the child program, after the callback. Only applies to code references.
Defaults to true.
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.
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.
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.
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.
| POE-Component-Supervisor documentation | view source | Contained in the POE-Component-Supervisor distribution. |