sub init_loop {
-Stem::Event::Queue::_init_queue() if defined &Stem::Event::Queue::_init_queue ;
-
$loop_class->_init_loop() ;
-
-<<<<<<< HEAD:lib/Stem/Event.pm
-#Stem::Event::Queue::_init_queue() if defined &Stem::Event::Queue::_init_queue ;
-=======
->>>>>>> master:lib/Stem/Event.pm
-
}
sub start_loop {
$loop_type = 'perl' unless $loop_to_class{ $loop_type } ;
my $loop_class = "Stem::Event::$loop_to_class{ $loop_type }" ;
-print "LOOP $loop_class\n" ;
+#print "LOOP $loop_class\n" ;
unless ( eval "require $loop_class" ) {
die "can't load $loop_class: $@" if $@ && $@ !~ /locate/ ;
############################################################################
package Stem::Event::Plain ;
-<<<<<<< HEAD:lib/Stem/Event.pm
-
-=======
->>>>>>> master:lib/Stem/Event.pm
our @ISA = qw( Stem::Event ) ;
=head2 Stem::Event::Plain::new
############################################################################
package Stem::Event::Signal ;
-<<<<<<< HEAD:lib/Stem/Event.pm
-
-=======
->>>>>>> master:lib/Stem/Event.pm
our @ISA = qw( Stem::Event ) ;
=head2 Stem::Event::Signal::new
############################################################################
package Stem::Event::Timer ;
-<<<<<<< HEAD:lib/Stem/Event.pm
-
-=======
->>>>>>> master:lib/Stem/Event.pm
our @ISA = qw( Stem::Event ) ;
=head2 Stem::Event::Timer::new
# these override Stem::Event's methods and then call those via SUPER::
package Stem::Event::IO ;
-<<<<<<< HEAD:lib/Stem/Event.pm
-
-=======
->>>>>>> master:lib/Stem/Event.pm
our @ISA = qw( Stem::Event ) ;
sub init_io_timeout {
package Stem::Event::Read ;
our @ISA = qw( Stem::Event::IO ) ;
-print "B @ISA\n" ;
-
-<<<<<<< HEAD:lib/Stem/Event.pm
-our @ISA = qw( Stem::Event::IO ) ;
-=======
->>>>>>> master:lib/Stem/Event.pm
=head2 Stem::Event::Read::new
sub new {
my( $class ) = shift ;
-print "@ISA\n" ;
my $self = Stem::Class::parse_args( $attr_spec_read, @_ ) ;
return $self unless ref $self ;
############################################################################
package Stem::Event::Write ;
-<<<<<<< HEAD:lib/Stem/Event.pm
-
-=======
->>>>>>> master:lib/Stem/Event.pm
our @ISA = qw( Stem::Event::IO ) ;
=head2 Stem::Event::Write::new
sub triggered {
my( $self ) = @_ ;
-
-<<<<<<< HEAD:t/event/event_test.pl
ok( 1, 'plain - event triggered' ) ;
-=======
- ok( 1, 'plain event triggered' ) ;
- Stem::Event::stop_loop() ;
->>>>>>> master:t/event/event_test.pl
}
sub test_signal_events {
return ;
}
- my $event2 = Stem::Event::Timer->new(
- 'object' => $self,
- 'method' => 'send_int_signal',
- 'delay' => 3,
- ) ;
-
- ok( ref $event2, 'signal delay timer created' ) ;
-
- Stem::Event::start_loop() ;
-
- ok( 1, 'signal - event loop exit' ) ;
- }
-}
-
-sub send_int_signal {
-
my $event = Stem::Event::Signal->new(
'object' => $self,
'signal' => 'INT',
ok( ref $event, 'signal - event created' ) ;
- $self->{'sig_event'} = $event ;
+ kill 'INT', $$ ;
+ $self->{'sig_event'} = $event ;
-print "kill INT\n" ;
+ Stem::Event::start_loop() ;
- kill 'INT', $$ ;
+ ok( 1, 'signal - event loop exit' ) ;
+ }
}
# callback method for signal
ok( 1, 'signal - event triggered' ) ;
$self->{'sig_event'}->cancel() ;
+
Stem::Event::stop_loop() ;
}
my( $self ) = @_ ;
-<<<<<<< HEAD:t/event/event_test.pl
ok( 1, 'hard timer - event triggered' ) ;
-=======
-send_int_signal() ;
-
- ok( 1, 'hard timer event triggered' ) ;
->>>>>>> master:t/event/event_test.pl
if ( --$self->{'hard_timer_count'} > 0 ) {