Skip to content

Commit

Permalink
Add IteratorStream docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed May 22, 2017
1 parent adac8fe commit bf2565b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/iterator-stream.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 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());
```

0 comments on commit bf2565b

Please sign in to comment.