Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 53517
Status: resolved
Priority: 0/
Queue: POE

People
Owner: Nobody in particular
Requestors: rob.hildred [...] hildredgroup.com
Cc:
AdminCc:

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



Subject: POE::NFA bug
Date: Fri, 08 Jan 2010 06:18:26 -0700
To: bug-POE [...] rt.cpan.org
From: rob.hildred [...] hildredgroup.com
Have been working with POE::NFA, using object states, and see three behaviors that may be bugs/or might be as designed and are candidates for the documentation.  In my code, each instantiation of an object spawns its own NFA

$VERSION = '1.280'

1.  When an object's method is called, the object returned in $_[OBJECT] is correct in the first state, but after a state transition, returns the object of another state machine (last one created?).  Workaround of using 'runstate => $self' in the constructor, and getting the object from $_[RUNSTATE].

2. Similar type of issue if I create two different objects from two different packages, both which spawn an NFA that handles identical state names and event names.  All is well until the first state transition, and then an event in package 'A' will try to run the event coderef from package 'B'.   Workaround is to guarantee state names are unique across all packages.

3.  Events are handled with the event handler registered for the state at the time of post rather than at the time of dispatch (assuming that the state changes in-between the two).  I can make the case for doing it either way, but it could be documented for those who are expecting the other.

Really enjoy POE.  Thanks.

Best Regards
Rob Hildred
skype: rob.hildred, 513-277-0435
Hi, Rob. Thank you for the thoughtful feedback. Would you be able to include one or more short test cases to illustrate your points?
Subject: RE: [rt.cpan.org #53517] POE::NFA bug
Date: Fri, 15 Jan 2010 17:48:56 -0700
To: bug-POE [...] rt.cpan.org
From: rob.hildred [...] hildredgroup.com

Message body is not shown because it is too large.

Message body is not shown because sender requested not to inline it.

Hi, Rob. The problem turned out to be very obscure. I'm not sure I would have spotted it without your test case. I've committed the following fix as revision 2803, and it'll be in the next POE release (hopefully this weekend). Index: lib/POE/NFA.pm =================================================================== --- lib/POE/NFA.pm (revision 2792) +++ lib/POE/NFA.pm (working copy) @@ -207,10 +207,7 @@ exists $params{+SPAWN_PACKAGES} ); - my $states = delete $params{+SPAWN_INLINES} if ( - exists $params{+SPAWN_INLINES} - ); - $states ||= {}; + my $states = delete($params{+SPAWN_INLINES}) || {}; if (exists $params{+SPAWN_OBJECTS}) { my $objects = delete $params{+SPAWN_OBJECTS};
Subject: RE: [rt.cpan.org #53517] POE::NFA bug
Date: Mon, 15 Feb 2010 14:19:49 -0700
To: bug-POE [...] rt.cpan.org
From: rob.hildred [...] hildredgroup.com
Than you Rocco.  I really appreciate the work you've put into this project.  You're not looking for work right now by any chance are you?

Best Regards
Rob


Show quoted text
Hi, Rob. No, I'm currently happy with my employment at Yahoo. I'll keep you in mind if that status changes. If you'd like to chat, please contact me at my CPAN e-mail address... every reply on this ticket is very much public, and they reopen the ticket. :)