http://qs1969.pair.com?node_id=574126


in reply to Re: Synchronizing STDERR and STDOUT
in thread Synchronizing STDERR and STDOUT

A couple of comments: this is for TAPx::Parser and one of the requirements is to have nothing which prevents it from installing in a fresh Perl install (i.e., no external dependencies), that means POE and friends are out of the question. Even if I make them optional, that doesn't solve my root problem :)

As for the plumbing loop, while I do like that idea, this thing is rapidly becoming far more complex than desired. Too many layers of indirection/abstraction are going to make this unmanageable. Already I have one major design flaw because of this problem and it's slowing down development. I might consider this option if I have no choice, but for now, I just want to pull from a stream. However, comments that others are making are rapidly convincing me that the synchronization issue can't be solved downstream. I do, however, have ideas on how to solve that little nit.

Cheers,
Ovid

New address of my CGI Course.

Replies are listed 'Best First'.
Re^3: Synchronizing STDERR and STDOUT
by nothingmuch (Priest) on Sep 21, 2006 at 18:37 UTC
    I was suggesting you remove a layer of abstraction - instead of keeping the stream loop inside of TAPx::Parser, let it remain outside so that it doesn't have to worry at all about blocking and synchronization and what not.

    The POE part is just to demonstrate that this approach (push parsing) works well in more situations than stream based iterators (that is, streams are usable with push parsers, but not vice versa).

    -nuffin
    zz zZ Z Z #!perl