-
Notifications
You must be signed in to change notification settings - Fork 45
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
Share environment variables between workers #273
Comments
@saartochner you can fork this repo and create a PR for it - that's the way how pull requests are usually created in github for OSS projects. Still, this is a bit of a controversial change because it doesn't play well with the idea of "mocha-parallel-tests" where it only supports "mocha" flags. Maybe it's better to just pass all environment variables from the main process to workers? |
@1999 Thanks for your answer! The idea behind dynamically synchronizing the environment variables is to synchronize the workers. Here's a word about my case, which causes me to think about this feature: |
Hey, |
Gotcha. I'd say your use case is pretty advanced so let's continue the discussion in your PR. |
Not sure where to post this but this seems the closest issue to what I'm running into. I need to be able to pass in different environment variables to each process. I'm planning to use this with physical hardware with each process having its own device that can't be shared. The idea being each process can have the ip address of the assigned device's ip but I don't see a way to do this. Appreciate the help. |
Hey,
Feature idea: adding
--share-envs
to the CLI, which will allow sharing environment variables between the workers.basically, this is simple
https://nodejs.org/api/worker_threads.html#worker_threads_worker_share_env
P.S. I implemented it and would be happy to open this as a PR.
Unfortunately, I don't have permission to open branches here so my hands are tied :(
The code is attached as zip
parallel.zip
The text was updated successfully, but these errors were encountered: