Morgan L. Owens wrote:
I suppose if you're lucky the consumer doesn't need to remember any state between one notification and the next, and it can treat every dataum like it's the first. But that is hardly the general case.
Actually 75% of my 'producers' are simply reading the next line from a file. Which is why the example given in the RFC got my goat so much - I don't recall ever trying to read the whole file into an array ;) . Wrapping that in an iterator gives me nothing and neither does 'yield' I think. My 'producer' simply needs to open the file and read it ... either as a raw line of text or a CSV conversion. Which the 'consumer' part of the relevant object simply processes.
The rest of my produces are data feeds from the database ... which already have a 'next' etc ... wrapping them in an iterator seems pointless as well? And essentially they already 'yield' ?
( Thanks for the links ... The php samples in sourcemaking.com look interesting ) -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php