1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-11-26 20:04:51 +01:00
byte-stream/docs/iterator-stream.md
2017-05-28 19:24:13 +02:00

344 B

title permalink
IteratorStream /iterator-stream

IteratorStream allows converting an Amp\Iterator that yields strings into an InputStream.

$inputStream = new IteratorStream(new Producer(function (callable $emit) {
    for ($i = 0; $i < 10; $i++) {
        yield new Delayed(1000);
        yield $emit(".");
    }
});