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