Socket
Socket
Sign inDemoInstall

pulse

Package Overview
Dependencies
2
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pulse

node.js client for Mozilla Pulse


Version published
Weekly downloads
17
increased by142.86%
Maintainers
0
Install size
1.84 MB
Created
Weekly downloads
 

Readme

Source

node-pulse

This is a node.js library for listening to Mozilla Pulse messages.

Installation

npm install pulse

Usage

var pulse = require("pulse");

var callback = function(message) {
  console.info("Success!  Your connection works, and you just recieved this:");
  console.info(message);
  console.info("Now closing connection...");
  conn.close();
}

var conn = pulse.createConsumer("test", "node-pulse-test");
conn.on("message", callback);

Consumers

Consumers are created by the createConsumer method and are instances of events.EventEmitter. Consumers emit two events:

  • message
  • error

createConsumer(type, name [, topics])

Creates a Consumer with the queue name name and listens to all the topics specified by the topics. topics can be an array of topics, a single topic, or if omitted, will default to all topics on the exchange (#). This method supports the following arguments for type:

  • test - binds to messages on the org.mozilla.exchange.pulse.test exchange.
  • meta - binds to messages on the org.mozilla.exchange.pulse exchange.
  • bugzilla - binds to messages on the org.mozilla.exchange.bugzilla exchange.
  • code - binds to messages on the org.mozilla.exchange.code exchange.
  • build - binds to messages on the org.mozilla.exchange.build exchange.

Consumer.close()

Closes the connection to the Pulse server.

Event: message

function(message) { }

Dispatched whenever a new message is received from Pulse.

Event: error

function(error) { }

Dispatched whenever this is an amqp error with the connection.

FAQs

Last updated on 03 Jun 2011

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc