šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

amqp-pubsub

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amqp-pubsub

Abstraction over admqplib for publish/subscribe communication patterns.

1.0.0
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
Ā 
Created
Source

amqp-pubsub

Minimalist abstraction layer for amqp publish/subscribe implementations

Installation

npm install amqp-pubsub

Usage

Publisher

var amqp = require('amqp');
var pubsub = require('amqp-pubsub');

var connection = amqp.createConnection({ host: "localhost" });

connection.on('ready', function() {
  var pubsubClient = pubsub(connection, 'amqp-pubsub-example');
  pubsubClient.publish({ test : 'hello world'});
});

Subscriber

var amqp = require('amqp');
var pubsub = require('../');

var connection = amqp.createConnection({ host: "localhost" });

connection.on('ready', function() {
  var pubsubClient = pubsub(connection, 'amqp-pubsub-example');

  pubsubClient.subscribe(function(message) {
    console.log(message);
  });
});

FAQs

Package last updated on 04 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts