neutralinojs / neutralino.js

JavaScript API for Neutralinojs

Home Page:https://neutralino.js.org/docs/api/overview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spawnedProcess event - pid needed!

ruslanx3m opened this issue · comments

If I run several processes at the same time, then some of them get the same id (Neutralino-scoped process identifier). Also, there is no process pid in the spawnedProcess event, but it is specified in the release https://github.com/neutralinojs/neutralinojs/releases/tag/v4.6.0

We need PID not ID (useless) !

{
  id: <id>,
  pid: <pid>,
  action: <action>,
  data: <data>
}

but we get only

{
  id: <id>,
  action: <action>,
  data: <data>
}

hey @ruslanx3m could you please share your code snipppet in order reproduce this issue in my local system.
although it is working fine for me, i am getting pId in my case.
image

Hi, I need for event to return PID not ID ... ?!

let nodeProc = await Neutralino.os.spawnProcess('node');

Neutralino.events.on('spawnedProcess', (evt) => {  // no PID in evt
    if(nodeProc.id == evt.detail.id) {
        switch(evt.detail.action) {
            case 'stdOut':
                console.log(evt.detail.data); // 10
                break;
            case 'stdErr':
                console.error(evt.detail.data);
                break;
            case 'exit':
                console.log(`Node.js process terminated with exit code: ${evt.detail.data}`);
                break;
        }
    }
});

await Neutralino.os.updateSpawnedProcess(nodeProc.id, 'stdIn', 'console.log(5 + 5);');
await Neutralino.os.updateSpawnedProcess(nodeProc.id, 'stdInEnd');

image

@shalithasuranga, I think this is a bug,
Could you please confirm from your end as well?