{"_id":"p-throttler","_rev":"13-35e3bb9b77dcfecb12d1d19809c8a498","name":"p-throttler","description":"A promise based throttler capable of limiting execution of parallel tasks","dist-tags":{"latest":"1.0.2"},"versions":{"0.0.1":{"name":"p-throttler","version":"0.0.1","description":"A promise based throttler capable of limiting execution of parallel tasks","main":"index.js","dependencies":{"q":"~0.9.2"},"devDependencies":{"mocha":"~1.10.0","expect.js":"~0.2.0"},"scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/IndigoUnited/node-p-throttler"},"bugs":{"url":"http://github.com/IndigoUnited/node-p-throttler/issues"},"keywords":["promise","throttler","trottle","deferred","worker","tasks","parallel"],"author":{"name":"IndigoUnited","email":"hello@indigounited.com","url":"http://indigounited.com"},"license":"MIT","_id":"p-throttler@0.0.1","dist":{"shasum":"c341e3589ec843852a035e6f88e6c1e96150029b","tarball":"https://registry.npmjs.org/p-throttler/-/p-throttler-0.0.1.tgz","integrity":"sha512-0JM0N02xfk0PIx4ip2FcM1eSZmuvF3BVegsGnDbBd1Z1D1HqHHwNyQ4MtjfvkNpMk+2wXYjQDmkukCBN7bXNog==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAiMa3K76cD+GSTYhkJgf9MiPi+uhAhUkPmJEqJ0xt9wIgZgZazHMySIpIofJpqWF8JP06zE7heNzIUVWnRqWIxHc="}]},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"maintainers":[{"name":"satazor","email":"andremiguelcruz@msn.com"}]},"0.1.0":{"name":"p-throttler","version":"0.1.0","description":"A promise based throttler capable of limiting execution of parallel tasks","main":"index.js","dependencies":{"q":"~0.9.2"},"devDependencies":{"mocha":"~1.10.0","expect.js":"~0.2.0"},"scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/IndigoUnited/node-p-throttler"},"bugs":{"url":"http://github.com/IndigoUnited/node-p-throttler/issues"},"keywords":["promise","throttler","trottle","deferred","worker","tasks","parallel"],"author":{"name":"IndigoUnited","email":"hello@indigounited.com","url":"http://indigounited.com"},"license":"MIT","homepage":"https://github.com/IndigoUnited/node-p-throttler","_id":"p-throttler@0.1.0","_shasum":"1b16907942c333e6f1ddeabcb3479204b8c417c4","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"maintainers":[{"name":"satazor","email":"andremiguelcruz@msn.com"}],"dist":{"shasum":"1b16907942c333e6f1ddeabcb3479204b8c417c4","tarball":"https://registry.npmjs.org/p-throttler/-/p-throttler-0.1.0.tgz","integrity":"sha512-qjBriqtlwhS2o/Yq4rU7ZQ4+Yy9Vy9d7qss15rof2viXAwwXcxjPq8jLXVJosXygOs3WZtKnLEzRw0FyX/l9PQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIArPuFrpkIlz8MhseuTZ5XHxTjCRaqUUMnDGC1jO0vemAiAi3vAnDq1panPORFpE77dpZ7TN05MOK4RcOM/+EZFzwQ=="}]}},"0.1.1":{"name":"p-throttler","version":"0.1.1","description":"A promise based throttler capable of limiting execution of parallel tasks","main":"index.js","dependencies":{"q":"~0.9.2"},"devDependencies":{"mocha":"~1.10.0","expect.js":"~0.2.0"},"scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/IndigoUnited/node-p-throttler"},"bugs":{"url":"http://github.com/IndigoUnited/node-p-throttler/issues"},"keywords":["promise","throttler","trottle","deferred","worker","tasks","parallel"],"author":{"name":"IndigoUnited","email":"hello@indigounited.com","url":"http://indigounited.com"},"license":"MIT","homepage":"https://github.com/IndigoUnited/node-p-throttler","_id":"p-throttler@0.1.1","_shasum":"15246409d225d3eefca85c50de710a83a78cca6a","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"maintainers":[{"name":"satazor","email":"andremiguelcruz@msn.com"}],"dist":{"shasum":"15246409d225d3eefca85c50de710a83a78cca6a","tarball":"https://registry.npmjs.org/p-throttler/-/p-throttler-0.1.1.tgz","integrity":"sha512-tKe6nsXWlgcAK+yWfm3kMg8CLi9SUUkeq8kXvoSW1TP5/ZepMFJRrEzWTkFPMyKReL7BeNQVtsN7J3AYArAVuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFn05QgKkAICO1DV4YRbD9RD0fK2nFvKkYqTW3M+ob9PAiEA2grsl+KsYJkPBn5eT0r8AYqLMFCgYsqsRd1ICWsNJV0="}]}},"1.0.0":{"name":"p-throttler","version":"1.0.0","description":"A promise based throttler capable of limiting execution of parallel tasks","main":"index.js","dependencies":{"promise":"^7.1.1"},"devDependencies":{"expect.js":"^0.3.1","mocha":"^2.1.0"},"scripts":{"test":"mocha -R spec --bail"},"repository":{"type":"git","url":"git://github.com/IndigoUnited/node-p-throttler.git"},"bugs":{"url":"http://github.com/IndigoUnited/node-p-throttler/issues"},"keywords":["promise","throttler","trottle","deferred","worker","tasks","parallel"],"author":{"name":"IndigoUnited","email":"hello@indigounited.com","url":"http://indigounited.com"},"license":"MIT","gitHead":"5739cb81ede70f0e8f3aca08bf724f884c2df62d","homepage":"https://github.com/IndigoUnited/node-p-throttler#readme","_id":"p-throttler@1.0.0","_shasum":"a9566dd85be89afcf7a3ab5e9dc5975622545aea","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"maintainers":[{"name":"satazor","email":"andremiguelcruz@msn.com"}],"dist":{"shasum":"a9566dd85be89afcf7a3ab5e9dc5975622545aea","tarball":"https://registry.npmjs.org/p-throttler/-/p-throttler-1.0.0.tgz","integrity":"sha512-qFQCU5M1R3oha9f0A8MWjauyGgV3d+eoUJ9h57Bgy+YcSdqwalWVpRuc22qZxcO9XE1ljR1FFtGkUa1uooeJJA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTxFPY4jtGRKghmsKX+CT5gFnEJtFNAWNhM8CD1ktbWAIgZmTg40WnVBdr68pfjznud0EGyjIPyONptKYYC4Vwsmc="}]}},"1.0.1":{"name":"p-throttler","version":"1.0.1","description":"A promise based throttler capable of limiting execution of parallel tasks","main":"index.js","dependencies":{"promise":"^7.1.1"},"devDependencies":{"expect.js":"^0.3.1","mocha":"^2.1.0"},"scripts":{"test":"mocha -R spec --bail"},"repository":{"type":"git","url":"git://github.com/IndigoUnited/node-p-throttler.git"},"bugs":{"url":"http://github.com/IndigoUnited/node-p-throttler/issues"},"keywords":["promise","throttler","trottle","deferred","worker","tasks","parallel"],"author":{"name":"IndigoUnited","email":"hello@indigounited.com","url":"http://indigounited.com"},"license":"MIT","gitHead":"67537e9dbc0ffec57306fce485561ec915a2ea6e","homepage":"https://github.com/IndigoUnited/node-p-throttler#readme","_id":"p-throttler@1.0.1","_shasum":"250cf451b29e5c8cdcd3ade05a8a363f0f4272ba","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"maintainers":[{"name":"satazor","email":"andremiguelcruz@msn.com"}],"dist":{"shasum":"250cf451b29e5c8cdcd3ade05a8a363f0f4272ba","tarball":"https://registry.npmjs.org/p-throttler/-/p-throttler-1.0.1.tgz","integrity":"sha512-lJ4XygEBW+qKNzRoB87LfJYKHVyW+i97UJNj2kcXonHBHP5n9ZcyPxlQ+kgbragXJC91KAsGgp1Pm0+9vPkFvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGLbtWgEc+LuFQYyosr0MpAhZCNTyc5/lYIutD+PdtZFAiEAtebLS8DC6pU4cqhcQZbSvxPVR4CcJ5WqPOh4fg8X3mY="}]}},"1.0.2":{"name":"p-throttler","version":"1.0.2","description":"A promise based throttler capable of limiting execution of parallel tasks","main":"index.js","devDependencies":{"expect.js":"^0.3.1","mocha":"^2.1.0"},"scripts":{"test":"mocha -R spec --bail"},"repository":{"type":"git","url":"git://github.com/IndigoUnited/node-p-throttler.git"},"bugs":{"url":"http://github.com/IndigoUnited/node-p-throttler/issues"},"keywords":["promise","throttler","trottle","deferred","worker","tasks","parallel"],"author":{"name":"IndigoUnited","email":"hello@indigounited.com","url":"http://indigounited.com"},"license":"MIT","engines":{"node":">=0.12"},"gitHead":"f9992e304492a74ba2e00480cc520ec69b6d1feb","homepage":"https://github.com/IndigoUnited/node-p-throttler#readme","_id":"p-throttler@1.0.2","_shasum":"4034d39f5ad0dcf0cf9f1fc4463d5a80ed236672","_from":".","_npmVersion":"2.14.9","_nodeVersion":"0.12.9","_npmUser":{"name":"satazor","email":"andremiguelcruz@msn.com"},"maintainers":[{"name":"satazor","email":"andremiguelcruz@msn.com"}],"dist":{"shasum":"4034d39f5ad0dcf0cf9f1fc4463d5a80ed236672","tarball":"https://registry.npmjs.org/p-throttler/-/p-throttler-1.0.2.tgz","integrity":"sha512-UJBJZT2DzoUjCdJPaffDLfez9wWKTvFj+ARBCGUTW+tXcdoQqs1hVDa//n4v7k0IRLBhIw33BbFjIGAoxPxUkw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEcpAt7Vj5kQ8dG59Wq5FvqHxj4eRk/9AHTqwR57iIxSAiEAl00NtP/d/5SRCe/RQe9I3yaZry1kIALeDvKXYce+92Q="}]}}},"readme":"# p-throttler\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]\n\n[npm-url]:https://npmjs.org/package/p-throttler\n[downloads-image]:http://img.shields.io/npm/dm/p-throttler.svg\n[npm-image]:http://img.shields.io/npm/v/p-throttler.svg\n[travis-url]:https://travis-ci.org/IndigoUnited/node-p-throttler\n[travis-image]:http://img.shields.io/travis/IndigoUnited/node-p-throttler.svg\n[david-dm-url]:https://david-dm.org/IndigoUnited/node-p-throttler\n[david-dm-image]:https://img.shields.io/david/IndigoUnited/node-p-throttler.svg\n[david-dm-dev-url]:https://david-dm.org/IndigoUnited/node-p-throttler#info=devDependencies\n[david-dm-dev-image]:https://img.shields.io/david/dev/IndigoUnited/node-p-throttler.svg\n\nA promise based throttler responsible for limiting execution of parallel tasks.\nThe number of parallel tasks may be limited and configured per type.\n\n\n## Installation\n\n`$ npm install p-throttler`\n\n\n## API\n\n### #create(defaultConcurrency, types)\n\nConstructs a new throttler.\n\nThe `defaultConcurrency` is the default maximum concurrent functions being run (-1 to specify no limits).   \nThe `types` allows you to specify different concurrencies for different types.   \n\nExample:\n\n```js\nvar throttler = PThrottler.create(15, {  // or new PThrottler()\n    'network_io': 10,\n    'disk_io': 50\n});\n```\n\n\n### .enqueue(func, [type]): Promise\n\nEnqueues a function to be ran. The function is expected to return a promise or a value.   \nThe returned promise is resolved when the function finishes execution.\n\nThe `type` argument is optional and can be a `string` or an array of `strings`.   \nUse it to specify the type(s) associated with the function.   \n\nThe function will run as soon as a free slot is available for every `type`.  \nIf no `type` is passed or is unknown, the `defaultConcurrency` is used.  \n\nThe execution order is guaranteed for functions enqueued with the exact same `type` argument.\n\nExample:\n\n```js\n\nvar method = function () {\n    return Q.resolve('foo');\n};\n\nvar throttler = PThrottler.create(15, {\n    'foo': 1,\n    'bar': 2\n});\n\n// Single type, will only run when a free slot for\n// \"foo\" is available\nthrottler.enqueue(function () {\n    return method();    // method() returns some promise\n}, 'foo')\n.then(function (value) {\n    console.log(value);\n});\n\n// Multiple type, will only run when a free slot for\n// \"foo\" and \"bar\" are available\nthrottler.enqueue(function () {\n    return method();    // method() returns some promise\n}, ['foo', 'bar'])\n.then(function (value) {\n    console.log(value);\n});\n```\n\n\n### .abort(): Promise\n\nAborts all current work being done.\nReturns a promise that is resolved when the current running functions finish to execute.   \nAny function that was in the queue waiting to be ran is removed immediately.\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n","maintainers":[{"name":"satazor","email":"andremiguelcruz@msn.com"}],"time":{"modified":"2022-06-23T05:52:54.698Z","created":"2013-05-27T21:43:20.951Z","0.0.1":"2013-05-27T21:43:24.318Z","0.1.0":"2014-09-07T23:46:27.464Z","0.1.1":"2014-09-08T00:20:55.030Z","1.0.0":"2016-01-02T18:36:24.237Z","1.0.1":"2016-01-02T18:38:59.396Z","1.0.2":"2016-01-03T09:54:20.241Z"},"author":{"name":"IndigoUnited","email":"hello@indigounited.com","url":"http://indigounited.com"},"repository":{"type":"git","url":"git://github.com/IndigoUnited/node-p-throttler.git"},"homepage":"https://github.com/IndigoUnited/node-p-throttler#readme","keywords":["promise","throttler","trottle","deferred","worker","tasks","parallel"],"bugs":{"url":"http://github.com/IndigoUnited/node-p-throttler/issues"},"license":"MIT","readmeFilename":"README.md","users":{"carsy":true}}