Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-03-01 04:28:37 +03:00
parent 544604a2bc
commit e0eb20f29b

View File

@ -377,13 +377,16 @@ module.ChildProcessPeer = core.ImageGridFeatures.Feature({
handlers: [ handlers: [
// XXX check if we are a child and setup communications with the // XXX check if we are a child and setup communications with the
// parent... // parent...
// ...checking if child is simple:
// process.send != null -> child
['start', ['start',
function(){ function(){
var that = this var that = this
// XXX do we need to handle stdout/stderr here??? // XXX do we need to handle stdout/stderr here???
// XXX need to handle both the child and parent processes... // XXX need to handle both the child and parent processes...
// ...make this reusable...
process.on('message', function(msg){ process.on('message', function(msg){
// Handle action call... // Handle action call...
// //
@ -405,8 +408,6 @@ module.ChildProcessPeer = core.ImageGridFeatures.Feature({
// do the call... // do the call...
var res = that[msg.action].apply(that, msg.args || []) var res = that[msg.action].apply(that, msg.args || [])
// XXX check if res is a promise/promise-like...
// return the value... // return the value...
if(!msg.ignore_return){ if(!msg.ignore_return){
res.then ? res.then ?