#!/usr/bin/perl package POE::Component::Supervisor::Supervised::Session; use Moose; use POE::Component::Supervisor::Handle::Session; use namespace::clean -except => 'meta'; with qw(POE::Component::Supervisor::Supervised); has '+handle_class' => ( default => "POE::Component::Supervisor::Handle::Session" ); __PACKAGE__->_inherit_attributes_from_handle_class; sub is_abnormal_exit { my ( $self, %args ) = @_; exists $args{error}; } __PACKAGE__ __END__ =pod =head1 NAME POE::Component::Supervisor::Supervised::Session - Helps L babysit POE sessions. =head1 SYNOPSIS POE::Component::Supervisor::Supervised::Session->new( start_callback => sub { return POE::Session->new( ); }, ); POE::Component::Supervisor::Supervised::Session->new( implicit_tracking => 1, # any sessions from _child create events start_callback => sub { POE::Component::Foo->spawn( ... ); }, ); =head1 DESCRIPTION This is a factory object that creates L objects. =head1 ATTRIBUTES See also L, all of the documented attributes that apply to handle creation are borrowed by this class. =over 4 =item handle_class The class to instantiate. Defaults to L. Note that attributes are inherited only from L. If your handle class requires additional attributes, you must subclass your own C variant. The C<_inherit_attributes_from_handle_class> method can then be invoked on your subclass to reinherit all the attributes. Read the source of L for more details. =back =head1 METHODS See also L. =over 4 =item spawn Called by L when a new instance of the child process should be spawned. =item is_abnormal_exit Used by C. See L for details. Returns true if the C argument is provided (it's added by the handle when a C signal is cought from one of the tracked sessions). =back =cut