Skip Menu |

This queue is for tickets about the POE-XS-Queue-Array CPAN distribution.

Report information
The Basics
Id: 53038
Status: open
Priority: 0/
Queue: POE-XS-Queue-Array

People
Owner: Nobody in particular
Requestors: jmmills@cpan.org (no email address)
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.006
Fixed in: (no value)



Subject: POE::XS::Queue::Array doesn't seem to sub-class properly
POE::XS::Queue::Array doesn't seem to respond to isa() requests when sub-classing. Test attached. Relevant system information: perl -v This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi uname -a Linux amelia 2.6.28-13-server #45-Ubuntu SMP Tue Jun 30 22:56:18 UTC 2009 x86_64 GNU/Linux prove -v pq.t pq.t .. ok 1 - use POE::XS::Queue::Array; ok 2 - The object isa My::Normal ok 3 - The object isa My::Normal::Derived ok 4 - The object isa My::Normal not ok 5 - The object isa My::DerivedQueue ok 6 - The object isa POE::XS::Queue::Array 1..6 # Failed test 'The object isa My::DerivedQueue' # at pq.t line 35. # The object isn't a 'My::DerivedQueue' it's a 'POE::XS::Queue::Array' # Looks like you failed 1 test of 6. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/6 subtests Test Summary Report ------------------- pq.t (Wstat: 256 Tests: 6 Failed: 1) Failed test: 5 Non-zero exit status: 1 Files=1, Tests=6, 0 wallclock secs ( 0.03 usr 0.02 sys + 0.02 cusr 0.01 csys = 0.08 CPU) Result: FAIL
Subject: pq.t
package My::Normal; use strict; use warnings; sub new { bless({}, shift); } 1; package My::Normal::Derived; use strict; use warnings; use base qw[My::Normal]; 1; package My::DerivedQueue; use strict; use warnings; use base qw[POE::XS::Queue::Array]; 1; package main; BEGIN { use Test::More; plan 'no_plan'; use_ok('POE::XS::Queue::Array'); } my $normal = My::Normal->new; isa_ok($normal, 'My::Normal'); my $derived = My::Normal::Derived->new; isa_ok($derived, 'My::Normal::Derived'); isa_ok($derived, 'My::Normal'); my $queue = My::DerivedQueue->new; isa_ok($queue, 'My::DerivedQueue'); isa_ok($queue, 'POE::XS::Queue::Array');
Same test results on Perl 5.8.8 on a Gentoo machine.
On Wed Dec 23 21:29:54 2009, JMMILLS wrote: Show quoted text
> POE::XS::Queue::Array doesn't seem to respond to isa() requests when > sub-classing.
From what I can tell this is an artifact of the T_PTROBJ code in the standard perl typemap that blesses into the return type name rather than using the class name passed into new(). I don't know that it's worth fixing. Do you have a specific need for this? Tony
In my specific use case I'm implementing a simple service framework (for some in house stuff @$work) built on top of Danga::Socket
that uses a priority queue to dispatch non-IO related asynchronous "bit's of" code.
Of course in my little framework I define a queue interface and was trying to use P::XS::Q::A as the default backend since i've found it to be rather fast in uses with POE.
This bug shouldn't be hard to work around for me but I thought it was an odd behavior worthy reporting.

Jason

On Fri Dec 25 01:06:24 2009, TONYC wrote:
Show quoted text
> On Wed Dec 23 21:29:54 2009, JMMILLS wrote:
> > POE::XS::Queue::Array doesn't seem to respond to isa() requests when
> > sub-classing.
>
> From what I can tell this is an artifact of the T_PTROBJ code in the
> standard perl typemap that blesses into the return type name rather than
> using the class name passed into new().
>
> I don't know that it's worth fixing.
>
> Do you have a specific need for this?
>
> Tony