{"_id":"co-thread","_rev":"222694","name":"co-thread","description":"spawn multiple co 'threads'","dist-tags":{"latest":"0.0.1"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"time":{"modified":"2021-06-03T15:40:57.000Z","created":"2014-02-01T17:52:20.766Z","0.0.1":"2014-02-01T17:52:20.766Z"},"users":{"fedor":true,"liunian":true},"repository":{"type":"git","url":"git://github.com/visionmedia/co-thread"},"versions":{"0.0.1":{"name":"co-thread","version":"0.0.1","repository":{"type":"git","url":"git://github.com/visionmedia/co-thread"},"description":"spawn multiple co 'threads'","main":"index.js","keywords":["co","thread","parallel"],"license":"MIT","devDependencies":{"co":"~3.0.2","co-request":"~0.1.1","make-test":"~0.1.0","should":"~3.1.2","mocha":"~1.17.1"},"bugs":{"url":"https://github.com/visionmedia/co-thread/issues"},"homepage":"https://github.com/visionmedia/co-thread","_id":"co-thread@0.0.1","dist":{"shasum":"57713f0ef4b87e5595d4f23711ffe4b3b6de5e74","size":1083,"noattachment":false,"key":"/co-thread/-/co-thread-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/co-thread/download/co-thread-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.15","_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"directories":{},"publish_time":1391277140766,"_cnpm_publish_time":1391277140766,"_hasShrinkwrap":false}},"readme":"\n# co-thread\n\n  Run a generator function in parallel N times.\n\n## Installation\n\n```\n$ npm install co-thread\n```\n\n## Example\n\n  Send a request in batches of `20` parallel GETs:\n\n```js\nvar thread = require('co-thread');\nvar get = require('co-request');\nvar co = require('co');\n\nco(function *(){\n  var times = 10;\n\n  while (times--) {\n    yield thread(function *(){\n      var res = yield get('http://google.com');\n      console.log(res.statusCode);\n    }, 20);\n  }\n\n})();\n```\n\n## License\n\n  MIT","_attachments":{},"homepage":"https://github.com/visionmedia/co-thread","bugs":{"url":"https://github.com/visionmedia/co-thread/issues"},"license":"MIT"}