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

mqemitter

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mqemitter - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

9

index.js

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

, assert = require('assert')
, nop = function() {}

@@ -58,2 +59,4 @@ function MQEmitter(opts) {

cb = cb || nop
if (this.concurrency > 0 && this.current >= this.concurrency) {

@@ -80,2 +83,3 @@

if (!message) {
// we are at the end of the queue
this.current--

@@ -95,2 +99,3 @@ } else {

if (matches.length === 0) {
callback()
return this._next(receiver)

@@ -126,5 +131,3 @@ }

if (that.num === 0) {
if (that.callback) {
that.callback()
}
that.callback()
mq._next(that)

@@ -131,0 +134,0 @@ }

{
"name": "mqemitter",
"version": "0.1.1",
"version": "0.1.2",
"description": "An Opinionated Message Queue with an emitter-style API",

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

@@ -197,1 +197,14 @@

})
test('without any listeners and a callback', function(t) {
var e = mq()
, expected = {
topic: 'hello world'
, payload: { my: 'message' }
}
e.emit(expected, function() {
t.equal(e.current, 1, 'there 1 message that is being processed')
t.end()
})
})

Sorry, the diff of this file is not supported yet

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