rcaputo/poe — pull request #12 by hubie (2012-04-24 17:19:10+00:00)
Title: Immediate state transitions in POE::NFA

I've run into a situation where POE::NFAs posting of state transitions into POEs event queue has become an issue. My machine processes a string of events and the output of the machine is completely dependant upon the type and order of previous events. As such, when an event causes a state change, I expect the change to happen immediately, because of and regardless of any not-yet-dispatched events in the event queue.

The crux of my issue is that due to NFAs non-immediate state transitions, the output of the machine is vastly different depending on whether or not the event queue contains any events at any point during its operation. While there are certainly ways to mitigate or eliminate the queuing of the next event to be processed until after the state change has been posted, this is not desirable nor always possible.

In my readings, I stumbled across a thread [ http://code.activestate.com/lists/perl-poe/29/ ] from over a decade[!] ago regarding this same issue. From my understanding, the core issue has not been completely resolved. I have implemented an 'immediate' option for POE::NFA that, when enabled, causes state changes to be sent with 'call' rather than with 'post', which resolves the aforementioned issue. I am hardly partial to my commits, but I would certainly appreciate further discussion on this topic.

Thanks!
David Huebner