Skip to content

Commit

Permalink
remove thread in example
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-horse committed May 16, 2014
1 parent 01cdaf8 commit ee91e82
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ $ npm install co-gather

```js
var gather = require('co-gather');
var thread = require('co-thread');
var wait = require('co-wait');
var co = require('co');

Expand All @@ -30,7 +29,14 @@ function *random() {
}

co(function *() {
var ret = yield gather(thread(random, 10));
var thunks = [
random,
random,
random,
random,
random
];
var ret = yield gather(thunks);
console.log(ret);
})();
```
Expand All @@ -39,16 +45,11 @@ co(function *() {

```
[
{ isError: false, value: 0 },
{ isError: true, error: [Error: error] },
{ isError: true, error: [Error: error] },
{ isError: true, error: [Error: error] },
{ isError: true, error: [Error: error] },
{ isError: true, error: [Error: error] },
{ isError: false, value: 5 },
{ isError: false, value: 6 },
{ isError: false, value: 7 },
{ isError: true, error: [Error: error] },
{ isError: true, error: [Error: error] }
{ isError: false, value: 4 }
]
```

Expand Down
10 changes: 8 additions & 2 deletions example.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

var gather = require('./');
var thread = require('co-thread');
var wait = require('co-wait');
var co = require('co');

Expand All @@ -15,6 +14,13 @@ function *random() {
}

co(function *() {
var ret = yield gather(thread(random, 10));
var thunks = [
random,
random,
random,
random,
random
];
var ret = yield gather(thunks);
console.log(ret);
})();

0 comments on commit ee91e82

Please sign in to comment.