[663] TAP/Parser.pm - next_nonblock() method
Eric Wilhelm
scratchcomputing at gmail.com
Thu Oct 4 19:27:16 BST 2007
# from Andy Armstrong
# on Wednesday 03 October 2007 02:03:
>> TAP/Parser.pm - next_nonblock() method
>> TAP/Parser/Iterator/Process.pm - is_ready() to support nonblocking
>
>Please don't. We already have a way of polling the iterators using
>select.
But that requires you to reach-around the Parser to get the handles out
of the Process object, then stick them in your own Select object ala
T::P::Multiplexer.pm. While I'll grant that this runs faster, I would
hate for that to be the only way to have a nonblocking parser.
Granted that next_nonblock() should not assume a select object in the
base class, but this requires a bigger change to the Parser, not just
reverting my change and saying "we don't need it."
In Multiplexer, you've had to add duplicate code to support Source
objects which have no filehandle. That says to me that the API needs
to be normalized. Even if Multiplexer doesn't want to do it *that* way
for speed reasons, having no next_nonblock() requires more
documentation than having it, thus making T::H harder to use where
blocking is a concern.
--Eric
--
"Because understanding simplicity is complicated."
--Eric Raymond
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------
More information about the tapx-dev
mailing list