Skip Menu |

This queue is for tickets about the POE-Loop-Prima CPAN distribution.

Report information
The Basics
Id: 55882
Status: resolved
Priority: 0/
Queue: POE-Loop-Prima

People
Owner: Nobody in particular
Requestors: APOCAL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.01
Fixed in: (no value)



Subject: This loop is broken with modern POE?
Hello, I am trying to test POE against many event loops as part of it's sanity check process. This loop will not even load properly as seen here: apoc@blackhole:~$ perl -MPrima -MPOE -e 'print $poe_kernel->poe_kernel_loop(), "\n"; $poe_kernel->run' Bad mode 0 at /usr/local/share/perl/5.10.0/POE/Loop/Prima.pm line 154. BEGIN failed--compilation aborted at (eval 38) line 1. could not import qw(Kernel) at -e line 0 BEGIN failed--compilation aborted. This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi POE v1.287 Prima v1.28 POE::Loop::Prima v1.01 I'm not sure what is the problem here but I'm willing to work with you to solve this. Please let me know how we should proceed :) Thanks again for your work on this POE module! -- ~Apocalypse
Uhh, the bug was apparently due to change of precedence in perlop... May I ask you to apply the following patch and see if it works for you? (it does for me) Thanks! --- /home/dk/src/perl/POE-Loop-Prima/lib/POE/Loop/Prima.pm 2009-12-22 13:06:22.048486213 +0100 +++ /usr/local/share/perl/5.10.0/POE/Loop/Prima.pm 2010-03-24 11:36:33.262063619 +0100 @@ -125,9 +125,9 @@ # Maintain filehandle watchers. my %mask = ( - MODE_RD => [ fe::Read, 'onRead' ], - MODE_WR => [ fe::Write, 'onWrite' ], - MODE_EX => [ fe::Exception, 'onException' ], + MODE_RD , [ fe::Read, 'onRead' ], + MODE_WR , [ fe::Write, 'onWrite' ], + MODE_EX , [ fe::Exception, 'onException' ], );
On Wed Mar 24 06:39:06 2010, KARASIK wrote: Show quoted text
> Uhh, the bug was apparently due to change of precedence in perlop... > May I ask you to apply the following patch and see if it works for you? > (it does for me) > > Thanks! > > > --- /home/dk/src/perl/POE-Loop-Prima/lib/POE/Loop/Prima.pm > 2009-12-22 13:06:22.048486213 +0100 > +++ /usr/local/share/perl/5.10.0/POE/Loop/Prima.pm 2010-03-24 > 11:36:33.262063619 +0100 > @@ -125,9 +125,9 @@ > # Maintain filehandle watchers. > > my %mask = ( > - MODE_RD => [ fe::Read, 'onRead' ], > - MODE_WR => [ fe::Write, 'onWrite' ], > - MODE_EX => [ fe::Exception, 'onException' ], > + MODE_RD , [ fe::Read, 'onRead' ], > + MODE_WR , [ fe::Write, 'onWrite' ], > + MODE_EX , [ fe::Exception, 'onException' ], > ); >
Hello, thanks for the patch! It now passes my "simple" test but hangs in POE::Test::Loops' testsuite - comp_tcp.t Attached is a patch against PoLo-Prima 1.01 that adds PTL support and also includes your patch ;) Thanks again! -- ~Apocalypse
Subject: prima.patch
diff -urbd POE-Loop-Prima-1.01/lib/POE/Loop/Prima.pm POE-Loop-Prima-1.01-myver/lib/POE/Loop/Prima.pm --- POE-Loop-Prima-1.01/lib/POE/Loop/Prima.pm 2007-09-23 01:07:50.000000000 -0700 +++ POE-Loop-Prima-1.01-myver/lib/POE/Loop/Prima.pm 2010-03-24 09:36:04.000000000 -0700 @@ -125,9 +125,9 @@ # Maintain filehandle watchers. my %mask = ( - MODE_RD => [ fe::Read, 'onRead' ], - MODE_WR => [ fe::Write, 'onWrite' ], - MODE_EX => [ fe::Exception, 'onException' ], + MODE_RD , [ fe::Read, 'onRead' ], + MODE_WR , [ fe::Write, 'onWrite' ], + MODE_EX , [ fe::Exception, 'onException' ], ); sub _loop_select_callback @@ -255,3 +255,11 @@ Dmitry Karasik, E<lt>dmitry@karasik.eu.orgE<gt>. =cut + +=begin poe_tests + +sub skip_tests { + return "Prima tests require the Prima module" if do { eval "use Prima"; $@ }; +} + +=end poe_tests diff -urbd POE-Loop-Prima-1.01/Makefile.PL POE-Loop-Prima-1.01-myver/Makefile.PL --- POE-Loop-Prima-1.01/Makefile.PL 2007-09-23 01:07:50.000000000 -0700 +++ POE-Loop-Prima-1.01-myver/Makefile.PL 2010-03-24 09:43:52.000000000 -0700 @@ -1,9 +1,69 @@ # $Id: Makefile.PL,v 1.2 2007/09/23 08:07:50 dk Exp $ use ExtUtils::MakeMaker; +use POE::Test::Loops; + +# Switch to default behavior if STDIN isn't a tty. + +unless (-t STDIN) { + warn( + "\n", + "=============================================\n\n", + "STDIN is not a terminal. Assuming --default.\n\n", + "=============================================\n\n", + ); + push @ARGV, "--default"; +} + +# Remind the user she can use --default. + +unless (grep /^--default$/, @ARGV) { + warn( + "\n", + "=============================================\n\n", + "Prompts may be bypassed by running:\n", + " $^X $0 --default\n\n", + "=============================================\n\n", + ); +} + +# Should we skip the network tests? + +my $prompt = ( + "Some of POE::Loop::Prima's tests require a\n" . + "functional network. You can skip these network\n" . + "tests if you'd like.\n\n" . + "Would you like to skip the network tests?" +); + +my $ret = "n"; +if (grep /^--default$/, @ARGV) { + print $prompt, " [$ret] $ret\n\n"; +} +else { + $ret = prompt($prompt, "n"); +} + +my $marker = 'run_network_tests'; +unlink $marker; +unless ($ret =~ /^Y$/i) { + open(TOUCH,"+>$marker") and close TOUCH; +} + +POE::Test::Loops::generate( 't', [ 'POE::Loop::Prima' ], 0 ); + WriteMakefile( NAME => 'POE::Loop::Prima', AUTHOR => 'Dmitry Karasik <dmitry@karasik.eu.org>', ABSTRACT_FROM => 'lib/POE/Loop/Prima.pm', VERSION_FROM => 'lib/POE/Loop/Prima.pm', PREREQ_PM => { POE => 0, Prima => 0 }, + + # Add support for POE::Test::Loops + test => { TESTS => 't/*.t t/poe_loop_prima/*.t' }, + clean => { FILES => 't/poe_loop_prima/*.t t/poe_loop_prima ' . $marker }, + META_MERGE => { + build_requires => { + 'POE::Test::Loops' => '1.034', + }, + }, );
fixed in 1.02 really sorry for the long delay -- forgotten it altogether :) /dk