On Thu, Jan 03, 2002 at 06:36:18PM -0500, Rocco Caputo wrote: > Rocco finally added pause_input() and resume_input() to > POE::Wheel::ReadWrite. Torvald Riegel will either be incredibly > relieved or intensely dismayed at this and the other input changes in > this version. I'm not dismayed :), although it isn't my favourite solution. I hope we can do better in the stream model ...
> (!!!) Rocco removed the experimental synchronous stuff from POE::NFA. > There is a slight chance that this may break backward compatibility in > programs that use POE::NFA. I guess it wont break anything. But I just have to stress that posting state transitions is not good! Event handlers aren't atomic anymore because the state transition is part of the handler action, but it is delayed ! An FTP example: Server is broken and sends several FTP replies first reply arrives: -client saves reply -does a goto state to change the machine's (and the procotol) state -wheel is resumed, nfa goto event is before the next input event -> works as you expected after the wheel behaviour changes next example, user session wants to abort the current command and try another one instead. PoCoCl::FTP accepts command events. user sessions posts abort and new_cmd events. -ftp session processes abort, posts nfa goto event -> event queue: new_cmd, nfa_goto -> ftp session has to reject new_cmd as the internal machine still seems to be busy processing the aborted cmd the workaround would be just another flag. but then you dont need nfa anymore. believe me, asynchronous state transitions are wrong ! it just produces race conditions and needs for additional synchronisation. torvald
