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 5.0.0 to 5.1.0

4

mqemitter-redis.js

@@ -21,4 +21,4 @@ 'use strict'

this.subConn = new Redis(opts.connectionString || opts)
this.pubConn = new Redis(opts.connectionString || opts)
this.subConn = opts.subConn || new Redis(opts.connectionString || opts)
this.pubConn = opts.pubConn || new Redis(opts.connectionString || opts)

@@ -25,0 +25,0 @@ this._pipeline = Pipeline(this.pubConn)

{
"name": "mqemitter-redis",
"version": "5.0.0",
"version": "5.1.0",
"description": "Redis-based MQEmitter",

@@ -5,0 +5,0 @@ "main": "mqemitter-redis.js",

'use strict'
const redis = require('./')
const Redis = require('ioredis')
const test = require('tape').test

@@ -117,1 +118,49 @@ const abstractTests = require('mqemitter/abstractTest.js')

})
test('external redis pubConn and subConn', function (t) {
t.plan(4)
const externalRedisSubConn = new Redis()
externalRedisSubConn.on('error', e => {
t.notOk(e)
})
externalRedisSubConn.on('connect', () => {
t.pass('redis subConn connected')
})
const externalRedisPubConn = new Redis()
externalRedisPubConn.on('error', e => {
t.notOk(e)
})
externalRedisPubConn.on('connect', () => {
t.pass('redis pubConn connected')
})
const e = redis({
subConn: externalRedisSubConn,
pubConn: externalRedisPubConn
})
let subConnectEventReceived = false
let 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.equal(e.subConn, externalRedisSubConn, 'uses external redis subConn')
t.equal(e.pubConn, externalRedisPubConn, 'uses external redis pubConn')
t.end()
})
}
}
})
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