var events = require('events')
var util = require('util')

function Messenger () {
    this.parent = new events.EventEmitter
    events.EventEmitter.call(this)
}
util.inherits(Messenger, events.EventEmitter)

Messenger.prototype.send = function () {
    var vargs = []
    vargs.push.apply(vargs, arguments)
    this.parent.emit.apply(this.parent, [ 'message' ].concat(vargs.slice(0, 2)))
}

module.exports = Messenger

var events = require('events')
var util = require('util')

function Messenger () {
    this.parent = new events.EventEmitter
    this.connected = true
    events.EventEmitter.call(this)
}
util.inherits(Messenger, events.EventEmitter)

Messenger.prototype.send = function () {
    var vargs = []
    vargs.push.apply(vargs, arguments)
    this.parent.emit.apply(this.parent, [ 'message' ].concat(vargs.slice(0, 2)))
}

module.exports = Messenger

Set `connected` to `true` on `Messenger`.
Set `connected` to `true` on `Messenger`.

Making `Messenger` more pseudo-`process`y by adding a `connected` flag
an setting it to `true`. This property is set to `true` on `process`
when Node.js IPC's `process.send` function is present and the IPC pipe
is open. I assume that this value will be set every time we use
`Messenger` and if we want it unset would could as easily pass in an
empty object.
