Take me over?
NAME
POE::Component::Supervisor::Supervised - A role for supervision descriptors.
VERSION
version 0.09
SYNOPSIS
# See e.g. POE::Component::Supervisor::Supervised::Proc;
DESCRIPTION
All children supervised by the POE::Component::Supervisor must compose this role.
This role provides an API for instantiating POE::Component::Supervisor::Handle as required by the supervisor, corresponding to living instances of the child. The POE::Component::Supervisor::Supervised objects serve as descriptors for these handles, and know how to spawn the actual child.
ATTRIBUTES
- restart_policy
-
One of
permanent,transientortemporary.Defaults to
transient.See
should_restart. - handle_class
-
This attribute should be extended by your class to provide a default for
_inherit_attributes_from_handle_class(and subsequentlycreate_handle) to work.
METHODS
- construct_handle
-
Calls
newonhandle_classwith the arguments. - create_handle
-
Iterates the inherited attributes and copies them from the
$self, and also passes$selfas thechildparameter, along with all provided arguments toconstruct_handle. - should_restart
-
Returns a boolean value, which instructs the supervisor as to whether or not the child should be restarted after exit.
If the child is
permanentthis always returns true.If the child is
transientthis returns true ifis_abnormal_exitreturns true.If the child is
temporarythis returns false. - is_abnormal_exit %args
-
Required.
Given exit arguments from the handle, check whether or not the exit was normal or not.
For example POE::Component::Supervisor::Supervised::Proc will by default check if the exit status is 0.
Only applies to
transientchildren. - spawn
-
Required.
Creates a new POE::Component::Supervisor::Handle object for the supervisor.
- respawn
-
An alias for
spawnby default.May be overridden if respawning requires cleanup first, or something like that.
- is_transient
- is_temporary
- is_permanent
-
Boolean query methods that operate on
restart_policy.