-
Notifications
You must be signed in to change notification settings - Fork 122
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
Can I use --experimental-permission in new worker_threads.Worder's execArgv? #1043
Comments
What do you mean by execArgv? If you want to create a worker when using the permission model, you should ensure to pass |
So actually |
You can call main thread-based permission, yeah. |
What's your use case? |
What about other threads?
Thank you for your attentive. I'm making a sandbox util to run code and keep them away from disk. There are many codes to run, so if I can use Currently, my code looks like sample 1 because the docs said it's "process-based permission": function fn (id) {
return child_process.fork(`/path/to/${id}.js`, [], {
execArgv: [ `--experimental-permission`, `--allow-fs-read=/path/to/${id}.js` ]
});
} And if actually it's "thread-based permission", I want to make it looking like sample 2: function fn (id) {
return new worker_threads.Worker(`/path/to/${id}.js`, {
execArgv: [ `--experimental-permission`, `--allow-fs-read=/path/to/${id}.js` ]
});
} |
Well, if you pass the correct arguments to the |
The doc said that's "process-based permission". But it's actually based on execArgv, does it mean that, it can also be used for create worker by design (and "process-based" is a only provisional loose wording used to emphasize the difference from "module-based")?
The text was updated successfully, but these errors were encountered: