This commit is contained in:
Jeena 2014-03-01 23:11:36 +01:00
parent d83376d5c7
commit 810a74a28b
13 changed files with 445 additions and 281 deletions

View file

@ -17,10 +17,9 @@ function (Nc, Channel) {
process.on('message', function (message, handle) {
if(message.data.hasOwnProperty('CREATE')) {
self.channel = new Channel(this, message.data['CREATE']);
self.channel = new Channel(self, message.data.options);
} else if (message.data.hasOwnProperty('KILL')) {
self.channel.destroy();
process.exit(0);
} else {
self.onMessage(message);
}
@ -41,6 +40,11 @@ function (Nc, Channel) {
Nc.trigger(message.recipient + '/controlCommand', message);
}
PipeToServer.prototype.destroy = function() {
this.send('coordinator', {destroy:this.channel.name});
this.process.exit(0);
};
return PipeToServer;
});