mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
544604a2bc
commit
e0eb20f29b
@ -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 ?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user