Skip to content

Commit

Permalink
Add readerIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Jul 25, 2018
1 parent d2e6153 commit ab15816
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,3 +391,14 @@ function multiWriter(writers: ...Writer): Writer {
};
}
```

A utility function will be provided to make any `Reader` into an
`AsyncIterator`, which has very similar semanatics.

```ts
function readerIterator(r: deno.Reader): AsyncIterator<ArrayBufferView>;
// Example
for await (let buf of readerIterator(socket)) {
console.log(`read ${buf.byteLength} from socket`);
}
```

0 comments on commit ab15816

Please sign in to comment.