I noted this behaviour early on, but why does:
use POE;
$|++;
POE::Session->create(
inline_states => {
_start => sub { print '->'; $_[KERNEL]->yield('a'); print '<-' },
a => sub { print 'a' },
},
);
$poe_kernel->run();
result in:
-><-a
instead of:
->a<-
???
Shouldn't ->yield not just enqueue an event, but also do a timeslice before
returning? I.e., actually yield?
If I modify yield by pasting in a $self->run_one_timeslice before returning,
I get the output I expected... but then POE crashes with an internal
consistency error... thrown from _data_ses_get_parent because of this line:
confess "internal inconsistency" unless exists $kr_sessions{$session};
Which I assume happens because the session is being deleted somewhere when
the last event has been invoked, but before the last event handler has
exited...
Is the "-><-a" result more desirable than "->a<-"? And if you don't beat me
to it, would you accept a patch that resulted in "->a<-"? That is, if I
_can_ figure out how to make it work?
Garrett
--
Garrett Goebel
IS Development Specialist
ScriptPro Direct: 913.403.5261
5828 Reeds Road Main: 913.384.1008
Mission, KS 66202 Fax: 913.384.2180
www.scriptpro.com [EMAIL PROTECTED]