{"_id":"breeze-queue","_rev":"234941","name":"breeze-queue","description":"Throttled parallel function invocation.","dist-tags":{"latest":"0.4.0"},"maintainers":[{"name":"jakeluer","email":""}],"time":{"modified":"2021-06-03T15:49:31.000Z","created":"2012-11-12T17:54:48.089Z","0.4.0":"2013-02-15T07:09:32.322Z","0.3.0":"2013-02-14T21:54:03.704Z","0.2.0":"2012-12-22T17:05:45.378Z","0.1.0":"2012-11-12T17:54:48.089Z"},"users":{},"author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"repository":{"type":"git","url":"git@github.com:qualiancy/breeze-queue.git"},"versions":{"0.4.0":{"name":"breeze-queue","version":"0.4.0","description":"Throttled parallel function invocation.","author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"license":"MIT","keywords":[],"repository":{"type":"git","url":"git@github.com:qualiancy/breeze-queue.git"},"engines":{"node":"*"},"main":"./index","scripts":{"test":"make test"},"dependencies":{"breeze-nexttick":"*","tea-type":"*"},"devDependencies":{"chai":"*","chai-spies":"*","component":"*","mocha":"*","mocha-phantomjs":"*"},"readmeFilename":"README.md","_id":"breeze-queue@0.4.0","dist":{"shasum":"ae8428b697df7e56a5cf7cdf26a9626874a99961","size":4603,"noattachment":false,"key":"/breeze-queue/-/breeze-queue-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/breeze-queue/download/breeze-queue-0.4.0.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"jakeluer","email":"jake@alogicalparadox.com"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1360912172322,"_cnpm_publish_time":1360912172322,"_hasShrinkwrap":false},"0.3.0":{"name":"breeze-queue","version":"0.3.0","description":"Throttled parallel function invocation.","author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"license":"MIT","keywords":[],"repository":{"type":"git","url":"git@github.com:qualiancy/breeze-queue.git"},"engines":{"node":"*"},"main":"./index","scripts":{"test":"make test"},"dependencies":{"breeze-nexttick":"*","tea-type":"*"},"devDependencies":{"chai":"*","chai-spies":"*","component":"*","mocha":"*","mocha-phantomjs":"*"},"readmeFilename":"README.md","_id":"breeze-queue@0.3.0","dist":{"shasum":"336736ec467a3fd860583e47b053707a4bdfed57","size":4550,"noattachment":false,"key":"/breeze-queue/-/breeze-queue-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/breeze-queue/download/breeze-queue-0.3.0.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"jakeluer","email":"jake@alogicalparadox.com"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1360878843704,"_cnpm_publish_time":1360878843704,"_hasShrinkwrap":false},"0.2.0":{"name":"breeze-queue","version":"0.2.0","description":"Throttled parallel function invocation.","author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"license":"MIT","keywords":[],"repository":{"type":"git","url":"git@github.com:qualiancy/breeze-queue.git"},"engines":{"node":"*"},"main":"./index","scripts":{"test":"make test"},"dependencies":{"breeze-nexttick":"*"},"devDependencies":{"chai":"*","chai-spies":"*","component":"*","mocha":"*","mocha-phantomjs":"*"},"readmeFilename":"README.md","_id":"breeze-queue@0.2.0","dist":{"shasum":"c05155cf0244964ba89943c8dcb65729198e8239","size":4236,"noattachment":false,"key":"/breeze-queue/-/breeze-queue-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/breeze-queue/download/breeze-queue-0.2.0.tgz"},"_npmVersion":"1.1.69","_npmUser":{"name":"jakeluer","email":"jake@alogicalparadox.com"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1356195945378,"_cnpm_publish_time":1356195945378,"_hasShrinkwrap":false},"0.1.0":{"name":"breeze-queue","version":"0.1.0","description":"Throttled parallel function invocation.","author":{"name":"Jake Luer","email":"jake@qualiancy.com","url":"http://qualiancy.com"},"license":"MIT","keywords":[],"repository":{"type":"git","url":"git@github.com:qualiancy/breeze-queue.git"},"engines":{"node":"*"},"main":"./index","scripts":{"test":"make test"},"dependencies":{"breeze-nexttick":"*"},"devDependencies":{"chai":"*","chai-spies":"*","component":"*","mocha":"*","mocha-phantomjs":"*"},"_id":"breeze-queue@0.1.0","dist":{"shasum":"7fd41058fe608725833d2491d88d28ca2cf89c90","size":4147,"noattachment":false,"key":"/breeze-queue/-/breeze-queue-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/breeze-queue/download/breeze-queue-0.1.0.tgz"},"_npmVersion":"1.1.63","_npmUser":{"name":"jakeluer","email":"jake@alogicalparadox.com"},"maintainers":[{"name":"jakeluer","email":""}],"directories":{},"publish_time":1352742888089,"_cnpm_publish_time":1352742888089,"_hasShrinkwrap":false}},"readme":"# breeze-queue [![Build Status](https://secure.travis-ci.org/qualiancy/breeze-queue.png?branch=master)](https://travis-ci.org/qualiancy/breeze-queue)\n\n> Throttled parallel function invocation.\n\n## Installation\n\n### Node.js\n\n`breeze-queue` is available on [npm](http://npmjs.org).\n\n    $ npm install breeze-queue\n\n### Component\n\n`breeze-queue` is available as a [component](https://github.com/component/component).\n\n    $ component install qualiancy/breeze-queue\n\n## Usage\n\n### Queue (iterator, concurrency)\n\n* **@param** _{Function}_ iterator \n* **@param** _{Number}_ concurrency (defaults to 10)\n* **@return** _{Object}_  queue api\n\nThe queue mechanism allows for a any number of\ndata objects to be processed by an iterator\nwhen they become available. The queue will processes\nitems in parellel, up to a given concurrently value,\nthen will wait until an item has finished until\nbeginning to process the next. The items queued\ncan have a callback executed when it has completed\nits iterator.\n\nIn addition, a queue may also have\nfunctions attached to listen for specific events.\nOn such event is an error. Should any item in the queue\nfail to process and provide an error to it's `next`\ncallback, no further items will be processed.\n\n```js\nvar Queue = require('breeze-queue');\n\nvar queue = Queue(function (obj, next) {\n  setTimeout(next, 10);\n}, 5);\n```\n\n\n### .length\n\n* **@return** _{Number}_  count of queued items\n\nProperty indicating the number of items current\nin the queue. An item is removed from this list\nprior to being processed.\n\n\n### .push (items[, callback[, autostart]])\n\n* **@param** _{Array}_ item or items to be added to the queue\n* **@param** _{Function}_ callback for completion of each item\n* **@param** _{Boolean}_ autostart process (defaults to false)\n\nYou can push an item or an array of items into\nthe queue for processing. The callback will be\ncalled for the completion of each item if the queue\nhas not entered into an error state. A `autostart`\nboolean my also be provided if you wish to start\nprocessing the queue with this push of items. If\nno pushes provide the autostart, then the queue\nmust be started manually with `.process()`.\n\nNote that if the queue has already been started but\nhas been drained of items, it will not start again\nwith another push unless the `autostart` toggle is present.\n\n```js\n// single item\nqueue.push({ hello: 'universe' });\n\n// multiple items\nqueue.push([\n    { hello: 'world' }\n  , { hello: 'universe' }\n]);\n\n// notify callback\nqueue.push({ hello: 'universe' }, notify);\n\n// autostart\nqueue.push({ hello: 'universe' }, true);\n\n// notify + autostart\nqueue.push({ hello: 'univeerse' }, notify, true);\n```\n\n\n### .process ()\n\n\nBegin the queue processing cycle. Has no impact if\nthe queue is already processing.\n\n```js\nqueue.process();\n```\n\n\n### .onerror\n\n* **@cb** {Error} object that was passed as error during iteration\n\nSetting this to a function will provide a listener\nshould an error occur. It will not be executed otherwise.\n\n```js\nqueue.onerror = function (err) {\n  console.error(err.message);\n};\n```\n\n\n### .saturated\n\n\nThis listener will be executed when the number of\nqueued items exceeds the current concurrency value.\nThis will be executed directly after the push of\nsaid items.\n\n```js\nqueue.saturated = function () {\n  console.log('the queue is saturated');\n};\n```\n\n\n### .empty\n\n\nThis listener will be executed when the queue is empty.\nIn other words, prior to the last item in the queue\nbeing processed.\n\n```js\nqueue.empty = function () {\n  console.log('the queue is on the last item');\n};\n```\n\n\n### .drain\n\n\nThis listener will be executed when all queued\nitems have been executed through the iterator.\n\n```js\nqueue.drain = function () {\n  console.log('the queue has processed all tiems');\n};\n```\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2012 Jake Luer <jake@qualiancy.com> (http://qualiancy.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","_attachments":{},"readmeFilename":"README.md","license":"MIT"}