nozavroni / csvelte

🕺🏻 CSV and Tabular Data library for PHP
http://phpcsv.com/
Other
6 stars 0 forks source link

Need something similar to Guzzle's PumpStream #127

Open nozavroni opened 7 years ago

nozavroni commented 7 years ago

I need something similar to what Guzzle calls a "PumpStream". I doubt mine needs to be quite so robust, but basically it just needs to do this:

read - when read is requested, it looks in the buffer (which is a BufferStream object), and if that is empty, it calls the user-specified function and fills the buffer with its return value. on the next read it reads from buffer until empty and repeats the process.

A few ideas for names:

I actually went with IteratorStream for what I needed this for, but it wouldn't hurt to still create a RespireStream... maybe...