Skip to content

Commit

Permalink
Introduces promise streams
Browse files Browse the repository at this point in the history
New concept: a promise for an iterable. Iterables include arrays,
objects with an "iterator" method that returns an iterator, iterators
(including generators and the new Queue).

The `next` method of a promise iterable may return a promise for the
next value, or the value may be a promise.

A new implementation of Queue provides an iterator interface.

`map`, `reduce`, `forEach`, and `buffer` are introduced for performing
various operations in parallel and serial, with input coming from any
iterable.  All of these support back-pressure, leaving values on the
input iteration until the number of concurrent promises have dropped
below some specified threshold.  All of these support notifications
for their internal buffer levels.

`all` has been reworked to accept a promise for any iterable.

This introduces a degree of conceptual unity around ES6 iterators.  As
such this drops support for SpiderMonkey's original iterators, and all
the corresponding shims.  This patch must only land in a
backward-incompatible release, probably v0.10.0.
  • Loading branch information
kriskowal committed Jul 7, 2013
1 parent a8c5022 commit 0e5d134
Show file tree
Hide file tree
Showing 2 changed files with 871 additions and 241 deletions.
Loading

0 comments on commit 0e5d134

Please sign in to comment.