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 0.0.2 to 0.0.3

5

History.md
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 @@ ==================

6

index.js

@@ -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"

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