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

socketmq

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socketmq - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

9

lib/message.js

@@ -7,8 +7,11 @@ var amp = require('amp')

exports.B_PUB = new Buffer(exports.PUB)
exports.B_REQ = new Buffer(exports.REQ)
exports.B_REP = new Buffer(exports.REP)
exports.encode = function(type, event, msg, id) {
var args = [new Buffer(type), new Buffer(event)]
var args = [type, new Buffer(event)]
if (msg) {
msg = Buffer.isBuffer(msg) ? msg : new Buffer(msg)
args.push(msg)
args.push(Buffer.isBuffer(msg) ? msg : new Buffer(msg))
}

@@ -15,0 +18,0 @@

@@ -39,3 +39,3 @@

// Generate id for callback and save it in inbox.
var id = 'req.inbox.' + this.n
var id = '.' + this.n
this.reqInbox[id] = callback

@@ -42,0 +42,0 @@ // send the buf to selected stream

@@ -10,2 +10,6 @@ var util = require('util')

var B_PUB = Message.B_PUB
var B_REQ = Message.B_REQ
var B_REP = Message.B_REP
/**

@@ -35,3 +39,3 @@ * Abstract socket class provides our user facing API.

Socket.prototype.pub = function(event, msg) {
var buf = Message.encode(PUB, event, msg)
var buf = Message.encode(B_PUB, event, msg)
this.queue.pub(send, this.streams, buf)

@@ -46,3 +50,3 @@ }

var q = this.queue.req(this.streams, callback)
var buf = Message.encode(REQ, event, msg, q.id)
var buf = Message.encode(B_REQ, event, msg, q.id)
send(q.stream, buf)

@@ -70,3 +74,3 @@ }

var reply = function(msg) {
var buf = Message.encode(REP, event, msg, inboxId)
var buf = Message.encode(B_REP, event, msg, inboxId)
send(stream, buf)

@@ -73,0 +77,0 @@ }

{
"name": "socketmq",
"version": "0.1.1",
"version": "0.1.2",
"description": "Lightweight stream-oriented messaging library for node.",

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

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