hookio/hook.io — Issue #157: event name depending on who is master
Author: PhilWaldmann
Created: 2012-01-21 15:25:59+00:00
State: open

Hey,

I'm not sure of it's a bug or not, but try the following:

hook1.js

```javascript
var Hook = require('hook.io').Hook;
var hook = new Hook( {
name: 'hook1'
});
hook.start();
setInterval(function(){
hook.emit('hello::hook');
}, 1000);
```

hook2.js

```javascript
var Hook = require('hook.io').Hook;
var hook = new Hook( {
name: 'hook2'
});
hook.start();
hook.on('**::hello::**', function(){
console.log('got event', this.event);
});
```

1. start hook1.js
2. start hook2.js
3. take a look at the log of hook2 (got event hello::hook)
4. kill hook1 and start it again (hook2 is now the master!)
5. take a look at the log of hook2 (got event hook1::hello::hook)

I know using `**::hello::**` is not the best way, but the event name should stay the same anyways, right?