dominictarr/pull-flow — pull request #1 by tounano (2014-06-30 12:17:52+00:00)
Title: flow.parallel won't end now on error.

The pull request is related to this issue:
https://github.com/dominictarr/pull-stream/issues/19

You can test the changes with the following code:

```js
var pull = require("pull-stream");
var flow = require("pull-flow");

var randomErrorStream = pull.Source( function () {
var counter = 0;
return function (end, cb) {
if (Math.round(Math.random() * 3) === 0) return cb(new Error("dummy"));
setTimeout( function () {
cb(null, ++counter);
}, Math.round(Math.random() * 1000));
}
})

pull(
randomErrorStream(),
flow.serial(),
pull.map(function (d) {return d+1}),
flow.parallel(10),
pull.Through( function (read) {
return function next (end, cb) {
read(end, function (end, data) {
if (end === true) { return cb(end)};
if (end) { console.error(end); return next(null, cb);}
return cb(end, data);
});
}
})(),
pull.log()
)
```