Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow commands IPC #465

Closed
odeadglaz opened this issue Feb 11, 2024 · 4 comments · Fixed by #498
Closed

Allow commands IPC #465

odeadglaz opened this issue Feb 11, 2024 · 4 comments · Fixed by #498

Comments

@odeadglaz
Copy link
Contributor

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);
});
@gustavohenke
Copy link
Member

Great suggestion, let's add it! 😄

@gustavohenke gustavohenke added this to the v9 milestone Feb 25, 2024
@odeadglaz
Copy link
Contributor Author

Glad to hear, I can attach it to my open PR and resolve the two issues at once 🌮

@odeadglaz
Copy link
Contributor Author

I tried adding it to the above mentioned PR, altho failed due to this issue. Do you plan to drop support for Node@16 over next major ? If so It won't be an issue rather just delaying this one.

@gustavohenke
Copy link
Member

Maybe, it's not in LTS anymore. But each feature in its own PR, please

@gustavohenke gustavohenke linked a pull request Aug 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants