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

hare

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hare - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

.jshintrc

22

lib/exchange.js

@@ -12,5 +12,5 @@ "use strict";

instance:{
instance: {
constructor:function (name, exchange) {
constructor: function (name, exchange) {
this._super(arguments);

@@ -21,3 +21,3 @@ this._exchange = exchange;

publish:function (routingKey, message, opts) {
publish: function (routingKey, message, opts) {
if (!message && routingKey) {

@@ -40,5 +40,5 @@ message = routingKey;

return comb.define([_Options, _GetConnection], {
instance:{
instance: {
constructor:function Exchange(name, getConnectionCb) {
constructor: function Exchange(name) {
this._super(arguments);

@@ -49,3 +49,3 @@ this.__exchange = null;

__createExchange:function __createExchange() {
__createExchange: function __createExchange() {
var exchangeName = this.exchangeName;

@@ -65,8 +65,8 @@ var ret = this.__exchange || this.getConnection().chain(function connectCb(connection) {

queue:function (name) {
queue: function (name) {
return new ExchangeQueue(name, this, this.__createExchange.bind(this));
},
getters:{
exchange:function () {
getters: {
exchange: function () {
return this.__createExchange().chain(function () {

@@ -79,5 +79,5 @@ return this.__exchange;

"static":{
OPTIONS:["type", "passive", "durable", "comfirm", "autoDelete", "noDeclare", "confirm"]
"static": {
OPTIONS: ["type", "passive", "durable", "comfirm", "autoDelete", "noDeclare", "confirm"]
}
}).as(module);

@@ -58,9 +58,2 @@ "use strict";

function end() {
return connect().chain(function (connection) {
connection.end();
});
}
var Hare = comb.define(_Options, {

@@ -72,2 +65,7 @@

constructor: function () {
this._super(arguments);
this._url = {};
},
url: function (url) {

@@ -77,3 +75,3 @@ if (isHash(url)) {

} else {
this._url = {url: url};
this._url.url = url;
}

@@ -83,12 +81,7 @@ return this;

"set": function set(opt, value) {
var options = this._options;
var opts = options.options || (options.options = {});
opts[opt] = value;
heartbeat: function (heartbeat) {
this._url.heartbeat = heartbeat;
return this;
},
"get": function get(opt) {
return this._options.options[opt];
},

@@ -165,3 +158,3 @@ connect: function () {

comb.logger.configure();
}
};

@@ -168,0 +161,0 @@ hare.noLog = function noLog() {

@@ -84,3 +84,2 @@ "use strict";

subscribe: function subscribe(listener) {
var queueName = this.queueName;
return this.__getQueue().chain(function getQueueCb(queue) {

@@ -87,0 +86,0 @@ this.__subscribe(queue, listener);

{
"name": "hare",
"version": "0.0.2",
"version": "0.0.3",
"description": "Wrapper around amqp to make common patterns easier",
"main": "index.js",
"scripts": {
"test": "make test"
"test": "it -r dot"
},

@@ -17,8 +17,10 @@ "repository": {

"amqp": "~0.1.3",
"comb": "~0.2.0"
"comb": "~0.2.0",
"grunt": "~0.4.1"
},
"devDependencies": {
"it": "0.0.5"
"it": "~0.2.6",
"grunt-it": "~0.3.1",
"grunt-contrib-jshint": "~0.5.4"
}
}

@@ -1,6 +0,8 @@

#Hare
[![Build Status](https://travis-ci.org/C2FO/hare.png)](https://travis-ci.org/C2FO/hare)
# Hare
Hare is a wrapper around [amqp](https://github.com/postwait/node-amqp) providing a cleaner chainable API for some of the common patterns.
##Installation
## Installation

@@ -12,3 +14,3 @@ ```

##Connecting
## Connecting

@@ -31,4 +33,16 @@ To connect to your `amqp` server you can pass in your options to `hare`

##WorkerQueues
### Heartbeat
You may also specify a heartbeat ([See here](http://www.rabbitmq.com/reliability.html))
```
hare({url : "amqp://guest:guest@localhost:5672", heartbeat: 2});
//or
hare({url : "amqp://guest:guest@localhost:5672"}).heartbeat(2);
```
## WorkerQueues
Worker queues allow you to ditribute messages to workers, where only one worker will recieve the message. Allowing for the distribution of resource intensive tasks across a worker pool.

@@ -57,3 +71,3 @@

##Publish/Subscribe
## Publish/Subscribe

@@ -82,3 +96,3 @@ Publish and Subscribe allows you to broadcast messages to multiple consumers at a time.

##Routing
## Routing

@@ -113,3 +127,3 @@

##Topics
## Topics

@@ -152,3 +166,3 @@ Topics is similar to routing except that it allows you to subscribe to messages on multiple criteria.

##Creating your own Queue
## Creating your own Queue

@@ -183,3 +197,3 @@ You may also use the `queue` method to create your own queue if the above patterns do not match your needs.

##Creating Exchanges
## Creating Exchanges

@@ -208,3 +222,3 @@ You may also use the `exchange` method to work with your own exchange.

##Logging
## Logging

@@ -233,3 +247,3 @@ `Hare` comes with a logger which is useful for debugging. By default logging is turned off.

##Configuring Defaults
## Configuring Defaults

@@ -242,3 +256,3 @@ You can configure defaults for all queues using the `queueOptions` options.

##License
## License

@@ -248,3 +262,3 @@

##Meta
## Meta

@@ -251,0 +265,0 @@ * Code: `git clone git://github.com/c2fo/hare.git`

Sorry, the diff of this file is not supported yet

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