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

enqueue

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enqueue - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

component.json

@@ -5,3 +5,3 @@ {

"description": "queue up async function calls without the overhead",
"version": "1.0.1",
"version": "1.0.2",
"keywords": [],

@@ -8,0 +8,0 @@ "dependencies": {},

1.0.2 / 2015-03-19
==================
* cleanup after timeouts
1.0.1 / 2015-03-19

@@ -3,0 +8,0 @@ ==================

@@ -28,3 +28,5 @@ /**

var pending = 1;
var tids = {};
var jobs = [];
var id = 0;

@@ -42,6 +44,7 @@ return function() {

var ctx = this;
id++;
// remove "on end" function if there is one
end = end ? args.pop() : noop;
jobs.push([ctx, args.concat(once(done))]);
jobs.push([id, ctx, args.concat(once(done(id)))]);
return next();

@@ -54,4 +57,5 @@

var ctx = job[0];
var args = job[1];
var id = job[0]
var ctx = job[1];
var args = job[2];
var finish = args[args.length - 1];

@@ -63,3 +67,3 @@

if (timeout) {
setTimeout(function() {
tids[id] = setTimeout(function() {
finish(new Error('job timed out'))

@@ -70,9 +74,12 @@ }, timeout);

// call the fn
return fn.apply(job[0], job[1]);
return fn.apply(job[1], job[2]);
}
function done() {
pending--;
next();
return end.apply(this, arguments);
function done(id) {
return function _done() {
clearTimeout(tids[id]);
pending--;
next();
return end.apply(this, arguments);
}
}

@@ -79,0 +86,0 @@ }

{
"name": "enqueue",
"version": "1.0.1",
"version": "1.0.2",
"description": "queue up function calls",

@@ -5,0 +5,0 @@ "keywords": [

@@ -29,3 +29,4 @@

concurrency: 2,
timeout: 1000
timeout: 1000,
limit: 10
};

@@ -53,3 +54,3 @@

- `limit` (default: `Infinity`): limit how many jobs can be queued up at any given time.
will return an `Error` if the limit has been reached.
`queue` will return an `Error` if the limit has been reached.

@@ -56,0 +57,0 @@ ### `queue(args..., [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