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

mqemitter-redis

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mqemitter-redis - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

19

mqemitter-redis.js

@@ -9,2 +9,3 @@ 'use strict'

var msgpack = require('msgpack-lite')
var EE = require('events').EventEmitter

@@ -29,2 +30,4 @@ function MQEmitterRedis (opts) {

this.state = new EE()
var that = this

@@ -48,2 +51,18 @@

this.subConn.on('connect', function () {
that.state.emit('subConnect')
})
this.subConn.on('error', function (err) {
that.state.emit('error', err)
})
this.pubConn.on('connect', function () {
that.state.emit('pubConnect')
})
this.pubConn.on('error', function (err) {
that.state.emit('error', err)
})
MQEmitter.call(this, opts)

@@ -50,0 +69,0 @@ }

8

package.json
{
"name": "mqemitter-redis",
"version": "2.1.0",
"version": "2.2.0",
"description": "Redis-based MQEmitter",

@@ -8,4 +8,4 @@ "main": "mqemitter-redis.js",

"inherits": "^2.0.1",
"ioredis": "^2.5.0",
"lru-cache": "^4.0.0",
"ioredis": "^3.0.0",
"lru-cache": "^4.1.1",
"mqemitter": "^2.0.0",

@@ -18,3 +18,3 @@ "msgpack-lite": "^0.1.14",

"pre-commit": "^1.0.7",
"standard": "^10.0.0",
"standard": "^10.0.2",
"tape": "^4.0.0"

@@ -21,0 +21,0 @@ },

@@ -29,1 +29,39 @@ 'use strict'

})
test('ioredis connect event', function (t) {
var e = redis()
var subConnectEventReceived = false
var pubConnectEventReceived = false
e.state.on('pubConnect', function () {
pubConnectEventReceived = true
newConnectionEvent()
})
e.state.on('subConnect', function () {
subConnectEventReceived = true
newConnectionEvent()
})
function newConnectionEvent () {
if (subConnectEventReceived && pubConnectEventReceived) {
e.close(function () {
t.end()
})
}
}
})
test('ioredis error event', function (t) {
var e = redis({host: '127'})
t.plan(1)
e.state.once('error', function (err) {
t.deepEqual(err.message.substr(0, 7), 'connect')
e.close(function () {
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