1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-11-27 04:14:49 +01:00

Add IteratorStream docs

This commit is contained in:
Niklas Keller 2017-05-22 10:33:48 +02:00
parent adac8fe7b6
commit bf2565baa0

View File

@ -1,3 +1,16 @@
# IteratorStream # IteratorStream
TBD `IteratorStream` allows converting an `Amp\Iterator` that yields strings into an `InputStream`.
```php
$emitter = new Emitter;
asyncCoroutine(function () use ($emitter) {
for ($i = 0; $i < 10; $i++) {
yield new Delayed(1000);
yield $emitter->emit(".");
}
});
$inputStream = new IteratorStream($emitter->iterate());
```