squaremo/rabbit.js — pull request #35 by cooldaemon (2013-04-19 08:04:46+00:00)
Title: Fixed a inherit Stream API

```javascript
var context = require('rabbit.js').createContext('amqp://localhost:5672');
context.on('ready', function() {
var sub = context.socket('SUB');
sub.setEncoding('utf8');

sub.connect('chat', function() {
sub.on('data', function (message) {
console.log('sub:', message)
})
});

var sub2 = context.socket('SUB');
sub2.setEncoding('utf8');

sub2.connect('chat', function() {
sub2.on('data', function (message) {
console.log('sub2:', message)
})

sub2.emit('data', 'hello')
});
});
```

$ node app.js
sub: hello
sub2: hello