mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixed #58
This commit is contained in:
parent
d83376d5c7
commit
810a74a28b
13 changed files with 445 additions and 281 deletions
|
|
@ -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;
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue