Skip to content

Allow commands IPC #465

@odeadglaz

Description

@odeadglaz

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);
});

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions