task-queue
Advanced tools
Comparing version 0.0.4 to 0.0.5
12
index.js
@@ -7,4 +7,4 @@ /** | ||
var _opts = options; | ||
var _array = this._opts.initialSize ? new Array(this._opts.initialSize) : []; | ||
var _running = this._opts.start | false; | ||
var _array = _opts.initialSize ? new Array(_opts.initialSize) : []; | ||
var _running = _opts.start | false; | ||
@@ -15,5 +15,5 @@ _opts.concurrency = this._opts.concurrency | 1; | ||
if (_running) { | ||
var i, actual_concurrency = _opts.concurrency > this._array.length ? this._array.length : _opts.concurrency; | ||
var i, actual_concurrency = _opts.concurrency > _array.length ? _array.length : _opts.concurrency; | ||
for (i = 0; i < actual_concurrency; i++){ | ||
var popped = this._array.pop(); | ||
var popped = _array.pop(); | ||
if (popped) | ||
@@ -36,3 +36,3 @@ setImmediate(function () { | ||
task.method = fn; | ||
this._array.push(task); | ||
_array.push(task); | ||
_exec(); | ||
@@ -42,3 +42,3 @@ }, | ||
if(this.size() > 0) | ||
return this._array.pop(); | ||
return _array.pop(); | ||
return null; | ||
@@ -45,0 +45,0 @@ }, |
{ | ||
"author" : "Roberto Sales <robertosalesc@dcc.ufba.br>", | ||
"name": "task-queue", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "async single worker tasks queue that supports concurrency, priority and provide simple interface for passing task arguments", | ||
@@ -6,0 +6,0 @@ "keywords": ["task", "queue", "worker", "concurrency", "async", "priority"], |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
2235
1