New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

async-queue-improved

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-queue-improved - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

12

index.js

@@ -92,10 +92,16 @@ var async = require('async'),

}, concurrency)
var finish = function(callback) {
var errors = queue.errors.length > 0 ? queue.errors : null
callback(errors)
queue.drain = null
}
// Convenience onComplete function
queue.onComplete = function(callback) {
if (queue.length() + queue.running()) {
queue.drain = callback
if (queue.length() + queue.running() > 0) {
queue.drain = finish.bind(null, callback)
}
else {
callback()
finish(callback)
}

@@ -102,0 +108,0 @@ }

{
"name": "async-queue-improved",
"version": "0.0.2",
"version": "0.0.3",
"description": "Improved queue based `async` package",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -24,11 +24,14 @@ // TODO: unit tests

q.push({id: 1, data:{fakeError: null, fakeResult:111, duration: 100}, timeout: 1000}, taskCallback)
q.push({id: 1, data:{fakeError: null, fakeResult:111, duration: 100}, timeout: 1000}, taskCallback)
q.push({id: 1, data:{fakeError: null, fakeResult:111, duration: 100}, timeout: 1000}, taskCallback)
q.push({id: 1, data:{fakeError: null, fakeResult:112, duration: 100}, timeout: 1000}, taskCallback)
q.push({id: 1, data:{fakeError: null, fakeResult:113, duration: 100}, timeout: 1000}, taskCallback)
setTimeout(function() {
q.push({id: 1, data:{fakeError: null, fakeResult:111, duration: 100}, timeout: 1000}, taskCallback)
}, 200)
q.push({id: 2, data:{fakeError: "hehe", fakeResult:114, duration: 100}, timeout: 1000}, taskCallback)
}, 100)
q.onComplete(function() {
console.log('queue complete! (errors %j)', q.errors.length)
q.onComplete(function(err) {
console.log('queue complete!')
if (err) {
console.log('(errors %j)', err.length)
}
})
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