-
-
Notifications
You must be signed in to change notification settings - Fork 253
Labels
Milestone
Description
Hey 👋
Currently when spawning commands via concurrently, you cannot send messages from spawned process to top process due to the fact that the 'spwanOptions' won't allow it.
It might be useful to allow consumers to configure this in order to allow ipc and create communication in between.
If this something that make sense for you, would love to contribute it 👍
Example of what potentially I would want:
// test.ts
const concurrency = concurrently([
{ name: 'Child Process', command: 'ts-node ./test2.ts' },
], {
killOthers: ['failure'],
});
const [subProcess] = concurrency.commands;
subProcess.process?.on('message', (data) => {
console.log('Sub process message:', data);
});
subProcess.process?.send({ parent: true });
//test2.ts
process.send?.({ child: true });
process.on('message', (msg) => {
console.log('Message from parent:', msg);
});