1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-12-02 09:17:50 +01:00
byte-stream/docs/iterator-stream.md
2017-05-22 10:36:19 +02:00

13 lines
304 B
Markdown

# IteratorStream
`IteratorStream` allows converting an `Amp\Iterator` that yields strings into an `InputStream`.
```php
$inputStream = new IteratorStream(new Producer(function (callable $emit) {
for ($i = 0; $i < 10; $i++) {
yield new Delayed(1000);
yield $emit(".");
}
});
```