Skip to content

Documentation: Init a worker with env vars #353

Open
@kellyselden

Description

@kellyselden

I have a few env vars (RANDOM_SEED, THREADS) that I was setting in my pool init code and attempting to read in the workers. I realise now that I don't think that it is supported in node. I wonder if we could support starting the workers with some env vars set, similar to how spawn/exec allow setting env vars.

Something like:

let pool = Pool(() => spawn(new Worker('./foo', {
  env: {
    RANDOM_SEED: 'kjhsdfjk',
    THREADS: '8'
  }
})));

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions