{"_id":"co-gather","_rev":"8-516b6322b7e23fad25c5c308ba0102dc","name":"co-gather","description":"Execute thunks in parallel with concurrency support and gather all the results","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"co-gather","version":"0.0.1","description":"Execute thunks in parallel with concurrency support and gather all the results","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/dead-horse/co-gather.git"},"files":["index.js"],"keywords":["co","parallel","gather","koa"],"author":{"name":"dead_horse","email":"dead_horse@qq.com","url":"http://deadhorse.me"},"license":"MIT","bugs":{"url":"https://github.com/dead-horse/co-gather/issues"},"homepage":"https://github.com/dead-horse/co-gather","devDependencies":{"co":"^3.0.2","co-wait":"^0.0.0"},"dependencies":{"co-thread":"0.0.1"},"_id":"co-gather@0.0.1","dist":{"shasum":"efa35fbef02c9f647d8a740b3f5db731862535bc","tarball":"https://registry.npmjs.org/co-gather/-/co-gather-0.0.1.tgz","integrity":"sha512-V5auBsoinyQfdwha8FIQuzby6m+c2899znQb4KNh7v/qCoBrD1aW/5uG/MPemdVPCxZa4ykpG6vOESW8Nbbi4w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJ5YpvP3tQdMBgxwfb+nFx1vBjmMt5G8qVBy0OV33pnAiEAh31SjjU79CxCzcrwiFFhYliRZdp8JfzkJwyFcnkhpJY="}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"directories":{}},"1.0.0":{"name":"co-gather","version":"1.0.0","description":"Execute thunks in parallel with concurrency support and gather all the results","main":"index.js","scripts":{"test":"egg-bin test","ci":"egg-bin cov"},"repository":{"type":"git","url":"git://github.com/cojs/gather.git"},"files":["index.js"],"keywords":["co","parallel","gather","koa"],"author":{"name":"dead_horse","email":"dead_horse@qq.com","url":"http://deadhorse.me"},"license":"MIT","bugs":{"url":"https://github.com/cojs/gather/issues"},"homepage":"https://github.com/cojs/gather","dependencies":{"co":"^4.6.0"},"devDependencies":{"egg-bin":"^4.7.1","egg-ci":"^1.8.0","mz-modules":"^2.1.0"},"ci":{"version":"8, 10"},"gitHead":"870329c75334c2ec8914070addf84639accb67c0","_id":"co-gather@1.0.0","_npmVersion":"5.8.0","_nodeVersion":"8.11.1","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"dist":{"integrity":"sha512-GIfRsuERAAabLPXBBNzh19B3vl57d+eno4BYoR7F2DSuCcKSpp3cddmtkicolQlh7mw1LcnFRU1SAPBZUCqhHQ==","shasum":"d892593a567a38a9d3a6b2e4bb5f9f7e4d60eb3f","tarball":"https://registry.npmjs.org/co-gather/-/co-gather-1.0.0.tgz","fileCount":5,"unpackedSize":5011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWCPuCRA9TVsSAnZWagAAky8P/0SWt3ZYqzJDSHVIqdGF\naj9i8L/zl8ShDktlLoEGhQ0t4FuAsNvwn7CBKJrb8zcqeQPTs7h4ezkyzVQ/\ncTDL502x9JP8wPI/r6C99NJd23MKrEMQ5F8xoF9/vL1ouHmrSmuof++BmJux\nw8U70OZDAVvNGihobDEOkDwxv2kJBvZ5T1j0tBvKPygUaCmAyZLQi5gBQvIv\nErLwO+7EoM6SLFtvPXIoPDqn8vSLxiEngPkQthj3JDdI0wIYaIIf5RddrlOp\nSeDSlNarypF0Ny+JRGmaJutfPgg5l3YTTlWQOvgsS0DMq7nzNfOASb2imZu+\nSW3s1qo1DPtCpx6cMzfPj4O85EuGQukFnqSZpirejm9ns4y3kFjBvZRZnuLC\nos/LxA8ToFenmYafJDUu4LXrlvs1zzCkRctFOfP+avFqgNs2dhCvYnG9Hl+X\nyNA6gAn8/uOCwR62vtMQdM0P5t6h3jSaAp1McoirtfB8GWyB8HTnHmd+L5or\noIQrfuW94jVaRAUzTLGh5e5mKX2NbX6SUcZCNtIGLKpYKUno9IHI202p7477\n1jsHL8lIKNFlUyqzVfP8Hj/Qybx+j93XAPB7+L7K6x7J6Xau7ftJafvbVtMc\nM4DhRIWCwlm+1Kd3Q4tNSEDjUx4qshszo3qJfJJPThKICB0E7FAq7fv0MKCW\n35HU\r\n=8WPA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDOIZwJUByX2mmNK0fQbVkWWgK9iR4Yr8K6fuEG0jtuPAiBymXAMPKd9IbsQZtkgvGyjFJPOk/Zppxm12JyPXdAksQ=="}]},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/co-gather_1.0.0_1532503022013_0.5818835897790307"},"_hasShrinkwrap":false},"1.0.1":{"name":"co-gather","version":"1.0.1","description":"Execute thunks in parallel with concurrency support and gather all the results","main":"index.js","scripts":{"test":"egg-bin test","ci":"egg-bin cov"},"repository":{"type":"git","url":"git://github.com/cojs/gather.git"},"keywords":["co","parallel","gather","koa"],"author":{"name":"dead_horse","email":"dead_horse@qq.com","url":"http://deadhorse.me"},"license":"MIT","bugs":{"url":"https://github.com/cojs/gather/issues"},"homepage":"https://github.com/cojs/gather","dependencies":{"co":"^4.6.0"},"devDependencies":{"egg-bin":"^4.7.1","egg-ci":"^1.8.0","mz-modules":"^2.1.0"},"ci":{"version":"8, 10"},"gitHead":"53197a43fd1777b35d69c90eea7c16952a358f5b","_id":"co-gather@1.0.1","_nodeVersion":"10.16.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-f3v1koF5sPfFhmI901quN9dwvHz02swCOqoAFi/DmODKARIMyOEdrUxIyAxYBS8nxf+WcbXPHrjcnel1A5suIw==","shasum":"71631d11122ac293819d083818d4ae7f3a39da4b","tarball":"https://registry.npmjs.org/co-gather/-/co-gather-1.0.1.tgz","fileCount":5,"unpackedSize":5423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeaN3sCRA9TVsSAnZWagAAyW8P/iDda5EP4PvCIFU95s+3\nevSppX/OwWoFozZoIGUtQ3Z8QbTX2wZ3c8lLFAvgYRsPZ6Uf2twSh1zk8ykt\nLlAKolSxYPvCl8S8VoXApyP10nOA0GmhY+njdGyz5G0AoAWYylyfQyV7vBjS\nQ4SXHPSrD53WSLiVXFH0pPuROLVDxJ/5TeEBqAv6bci2b31gLYqKBHVnX9lT\ntrFx2CqkSVBMdEvTX+uMsHwykS9AvudCvwSI8aTplQ0s0WhU/11dB5M4NPDF\ny10cc9w7ZSXDxUs74Bs+g/I1trem+qONCQrrZJARrIA+5ymNIUNGSjpP/fLG\nJXscVnZf2uZ4WPqSUYFMshDfDvFImfiQC7YjEOx04jZFxI0/KWtx4v7Yyc6q\np+TXEQRD48iovNWINwXWW++1IO3mmZNhuDa2S1C7OpX8B42XKvDS+f+ppR7t\n/pfFl1uDB5qhiRdDD8NYFH1fEXMoZvovZ7lwP+D3CflAFdpRhYu6fDiUo749\na/LhpcbESFOf+e70PRmzHUrhQuO1QunO1GBZEaenKUgmFV18GXe+VWntLXHO\nFbnqYdZ3J6hU2y2Njgnjdv5nRuDI7X37a76SLz7TgvlzeOgnIyE0lWiFSGzb\nnofG8Ftv5kmEW3LFLCYsOwVw0w5Vl1FgqfWAS/6IQ7xQ/kGj8atHkUCNax5D\nXBvv\r\n=6XeN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMMppvL9cxt5l4LfCbQg1JTS776FILgz6+dSkO7A+RLAIhAOqKk4Pk0T9kswB4A5ai4mZDno9rj7JnqNhKK5hT97Gk"}]},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/co-gather_1.0.1_1583930860333_0.6749498718700726"},"_hasShrinkwrap":false}},"readme":"co-gather\n=========\n\nExecute thunks, generators, async functions in parallel with concurrency support and gather all the results.\n\n`co-gather` is similar with [co-parallel](https://github.com/visionmedia/co-parallel), but `co-gather` will gather all the result of these thunks, even those thunks throw error.\n\n## Installation\n\n```\n$ npm install co-gather\n```\n\n## Example\n\n```js\nconst gather = require('./');\nconst sleep = require('mz-modules/sleep');\n\nfunction* gfun(result, error, interval) {\n  yield sleep(interval || 100);\n  if (error) throw new Error(error);\n  return result;\n}\n\nasync function afun(result, error, interval) {\n  await sleep(interval || 100);\n  if (error) throw new Error(error);\n  return result;\n}\n\nconsole.time('gather');\ngather([\n  gfun(1),\n  gfun(null, 'error'),\n  async () => afun(null, 'error'),\n  () => afun(4),\n], 2).then(res => {\n  console.timeEnd('gather');\n  console.log(res);\n});\n```\n\n=>\n\n```\n[\n  { isError: false, value: 1 },\n  { isError: true, error: [Error: error] },\n  { isError: true, error: [Error: error] },\n  { isError: false, value: 4 }\n]\n```\n\n## API\n\n\n## gather(items, [concurrency])\n\nExecute `items` in parallel, with the given concurrency defaulting to 5, and gather the result\n\n## License\n\nMIT\n","maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"time":{"modified":"2022-06-13T06:23:04.279Z","created":"2014-03-06T12:59:03.210Z","0.0.1":"2014-03-06T12:59:03.210Z","1.0.0":"2018-07-25T07:17:02.115Z","1.0.1":"2020-03-11T12:47:40.456Z"},"homepage":"https://github.com/cojs/gather","keywords":["co","parallel","gather","koa"],"repository":{"type":"git","url":"git://github.com/cojs/gather.git"},"author":{"name":"dead_horse","email":"dead_horse@qq.com","url":"http://deadhorse.me"},"bugs":{"url":"https://github.com/cojs/gather/issues"},"license":"MIT","readmeFilename":"README.md","users":{"liunian":true}}