On Friday 07 December 2001 12:56 am, you wrote:
> On Thu, Dec 06, 2001 at 05:20:05PM -0500, Jason Boxman wrote:
> > On Thursday 06 December 2001 04:02 pm, you wrote:
> > > How should I detect EOF on the stdout from POE::Wheel::Run?
> > >
> > > SIGCHLD seems to come well before the last StdoutEvent, buffering
> > > I expect.  I also see two ErrorEvents (ARG0='read', ARG1=0).  One
> > > soon after the SIGCHLD and another after the last StdoutEvent.
> >
> > Yeah, I get something like that with my POE::Wheel.  Sometimes I don't
> > get all the data from the STDOUT pipe before it finishes up and goes
> > away.  I actually resorted to using a sleep 2; call in my Wheel's
> > executed coderef, but that's surely a kludge.
>
> This should be fixed in 0.17 or later, although it may not be if
> you're deleting the Wheel::Run instance before the pipes can be
> flushed.  It would be best to have Wheel::Run track the pipes' status
> and emitting a "hey, close me" event when it's done.

I use STDERR to signal The Wheel::Run's job completion as I'm using STDOUT as 
a data stream channel.  When I get a specific 'done' event from STDERR I kill 
the wheel.  I guess it's possible the STDERR event is caught before the 
STDOUT pipe is flushed.  The sleep 2; fixed this in most instances, but I 
still end up with lost data 5-10% of the time.

Wheel::Run is handling my LWP::UserAgent request, which I'd like to replace 
entirely with SocketFactory / Wheel::ReadWrite and Filter::HTTPD / 
Filter::Stream as per my earlier post today.

> -- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sourceforge.net

Reply via email to