Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

queue

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

queue - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

test/stop.js

26

index.js

@@ -29,2 +29,3 @@ /**

this.session = 0;
this.running = false;
this.jobs = [];

@@ -49,9 +50,7 @@ }

for (var method in arrayMethods) {
(function(method) {
Queue.prototype[method] = function() {
return Array.prototype[method].apply(this.jobs, arguments);
};
})(arrayMethods[method]);
}
for (var method in arrayMethods) (function(method) {
Queue.prototype[method] = function() {
return Array.prototype[method].apply(this.jobs, arguments);
};
})(arrayMethods[method]);

@@ -104,3 +103,3 @@ /**

done.call(self);
} else {
} else if (self.running) {
self.start();

@@ -124,2 +123,3 @@ }

this.pending++;
this.running = true;
job(next);

@@ -133,2 +133,9 @@

/**
* stop / pause
*/
Queue.prototype.stop = function() {
this.running = false;
};
/**
* clear the queue including any running jobs

@@ -149,4 +156,5 @@ */

function done(err) {
this.session++;
this.running = false;
this.emit('end', err);
this.session++;
};
{
"name": "queue",
"version": "2.1.2",
"version": "2.2.0",
"description": "async job queue with adjustable concurrency",

@@ -5,0 +5,0 @@ "repository": {

@@ -20,3 +20,4 @@ ```

* `start()`
* `end([err])` if you pass a `err` it will be available to 'end' event handlers when triggered
* `stop()`
* `end([err])` stop and empty the queue immediately

@@ -23,0 +24,0 @@ inherited from `Array`:

@@ -6,2 +6,3 @@ require('./synchronous');

require('./error');
require('./stop');
require('./end');
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc