Comparing version 0.0.2 to 0.0.3
0.0.3 / 2014-08-02 | ||
================== | ||
* only start pending when we actually have a job | ||
0.0.2 / 2014-08-01 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -22,3 +22,2 @@ /** | ||
concurrency = concurrency || 1; | ||
var pending = 1; | ||
@@ -43,5 +42,6 @@ var jobs = []; | ||
if (pending > concurrency) return; | ||
var job = jobs.shift(); | ||
if (!job) return; | ||
pending++; | ||
var job = jobs.shift(); | ||
return job && job[0].apply(job[1], job[2]); | ||
return job[0].apply(job[1], job[2]); | ||
} | ||
@@ -48,0 +48,0 @@ |
{ | ||
"name": "enqueue", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "queue up function calls", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -9,2 +9,3 @@ | ||
```js | ||
var enqueue = require('enqueue'); | ||
var fn = enqueue(function(ms, msg, done) { | ||
@@ -17,5 +18,5 @@ setTimeout(function() { | ||
fn(100, 'one', noop); | ||
fn(50, 'two', noop); | ||
fn(25, 'three', noop); | ||
fn(100, 'one', function(){}); | ||
fn(50, 'two', function(){}); | ||
fn(75, 'three', function(){}); | ||
@@ -22,0 +23,0 @@ // execution order: "two", "one", "three" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3344
43
61