{"author":{"name":"Dmitry Filatov","email":"dfilatov@yandex-team.ru"},"description":"Short package description","name":"vow-queue","version":"0.0.1","contributors":[{"name":"Dmitry Filatov","email":"dfilatov@yandex-team.ru"}],"engines":{"node":">= 0.8.0"},"peerDependencies":{"vow":"~0.3.9"},"devDependencies":{"vow":"~0.3.9","jshint":"2.1.3","mocha":"1.11.0","chai":"*","jscs":"1.0.0","istanbul":"0.1.39","mocha-istanbul":"*"},"scripts":{"test":"make validate","lint":"make lint","coverage":"make coverage","clean":"make clean"},"_id":"vow-queue@0.0.1","dist":{"shasum":"bcc3ab4cd7fb9d46586530cc21ebecfdbbfdb387","tarball":"http://registry-npm.ywwl.com/vow-queue/download/vow-queue-0.0.1.tgz","integrity":"sha512-LaMJAcpL1yrYOvdNgFZetJF+cd/YtCBGBDBvXCqJe+MaE987g2p6enAY4UC4t/RSlrW4yqJE++vmaMTDe+Zk0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDacNYXbts9LrIv7zovjY44TbcpAcTAVBoCShJUf6bT8AIgffvLMIhSj1B4gxDNjSoxW1w8MWPs6rNKFokWR/ZeU7Y="}],"size":3860,"noattachment":false,"key":"/vow-queue/-/vow-queue-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"dfilatov","email":"dfilatov@yandex-team.ru"},"maintainers":[{"name":"dfilatov","email":"dfilatov@yandex-team.ru"}],"directories":{},"readme":"vow-queue [![NPM version](https://badge.fury.io/js/vow-queue.png)](http://badge.fury.io/js/vow-queue) [![Build Status](https://secure.travis-ci.org/dfilatov/vow-queue.png)](http://travis-ci.org/dfilatov/vow-queue)\n===============\n\nvow-queue is a module for task queue with weights and priorities\n\nInstallation\n------------\n\nModule can be installed using `npm`:\n\n```\nnpm install vow-queue\n```\n\nor `bower`:\n\n```\nbower install vow-queue\n```\n\nUsage\n-----\n\n````javascript\nvar Queue = require('vow-queue'),\n    queue = new Queue({ weightLimit : 10 });\n    \nqueue.enqueue(function() { // simple function\n    return 2 * 2;\n});\n\nqueue.enqueue(function() { // function returns a promise\n    // do job\n    return promise;\n});\n\nqueue.enqueue( // task with custom priority and weight\n    function() {\n        // do job\n    },\n    {\n        priority : 3, // this task will be started before the previous two\n        weight   : 5\n    });\n    \nqueue.start(); // starts tasks processing\n\nqueue.enqueue(function() { }); // and enqueue yet another task\n````\n\nAPI\n-----\n### Creating queue\n####new Queue([params])\n  * `params.weightLimit=100` limit of summary tasks weight which can be processed concurrently\n\n### Methods of queue\n####Promise enqueue(taskFn, [taskParams])\nEnqueue given task in queue\n  * `taskFn` task function which can return either a promise or a value\n  * `taskParams.weight=1` weight of given task\n  * `taskParams.priority=1` priority of given task\n\nReturns promise which will be resolved when given task is done\n\n####void start()\nStarts processing of tasks in queue\n\n####void stop()\nStops processing of tasks in queue\n\n####Boolean isStarted()\nReturns whether processing is started\n\n####void setParams(params)\nSets queue params\n* `params.weightLimit=100` limit of summary tasks weight which can be processed concurrently\n\n####Object getStats()\nReturns statistics about queue\n","publish_time":1372969115009,"_cnpm_publish_time":1372969115009,"dist-tags":{"latest":"0.4.3"}}