Socket
Socket
Sign inDemoInstall

concurrent-queue

Package Overview
Dependencies
8
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.1 to 6.0.0

43

index.js

@@ -44,23 +44,2 @@ var assert = require('assert'),

}
cq.limit = function (limits) {
limits = assign({ concurrency: Infinity, maxSize: Infinity }, limits)
assert(typeof limits.maxSize === 'number', 'maxSize must be a number')
assert(typeof limits.concurrency === 'number', 'concurrency must be a number')
maxSize = limits.maxSize
concurrency = limits.concurrency
return cq
}
cq.process = function (func) {
assert(typeof func === 'function', 'process requires a processor function')
assert(!processor, 'queue processor already defined')
processor = func
setImmediate(drain)
return cq
}
cq.enqueued = eventuate()
cq.rejected = eventuate()
cq.processingStarted = eventuate()
cq.processingEnded = eventuate()
cq.drained = eventuate()
Object.defineProperties(cq, {

@@ -97,3 +76,23 @@ size: { enumerable: true, get: function () {

return processor
}}
}},
limit: { value: function (limits) {
limits = assign({ concurrency: Infinity, maxSize: Infinity }, limits)
assert(typeof limits.maxSize === 'number', 'maxSize must be a number')
assert(typeof limits.concurrency === 'number', 'concurrency must be a number')
maxSize = limits.maxSize
concurrency = limits.concurrency
return cq
}},
process: { value: function (func) {
assert(typeof func === 'function', 'process requires a processor function')
assert(!processor, 'queue processor already defined')
processor = func
setImmediate(drain)
return cq
}},
enqueued: { value: eventuate() },
rejected: { value: eventuate() },
processingStarted: { value: eventuate() },
processingEnded: { value: eventuate() },
drained: { value: eventuate() }
})

@@ -100,0 +99,0 @@

{
"name": "concurrent-queue",
"version": "5.0.1",
"version": "6.0.0",
"description": "Fifo queue with concurrency control",

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

@@ -67,6 +67,4 @@ var test = require('tape'),

var numbers = [1, 9, 3, 0, 8, 4, 7, 2, 5, 6]
numbers.forEach(function (num) {
q(num)
})
numbers.forEach(q)
}
})
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc