diff options
author | Yael Hermon <yaelhe@wix.com> | 2019-01-04 20:02:25 +0200 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-01-18 05:39:58 +0100 |
commit | 01cd21973b26a2cbacbe143c5983cb4adf8e7681 (patch) | |
tree | 16d2712ba9e73dfdb9612acbcde6e0bd8423e097 /src/node_worker.h | |
parent | 74562356db6964f8057ef4bd897725793e55d513 (diff) | |
download | android-node-v8-01cd21973b26a2cbacbe143c5983cb4adf8e7681.tar.gz android-node-v8-01cd21973b26a2cbacbe143c5983cb4adf8e7681.tar.bz2 android-node-v8-01cd21973b26a2cbacbe143c5983cb4adf8e7681.zip |
worker: enable passing command line flags
This PR adds the ability to provide Workers with their own
execArgv flags in replacement of the main thread's execArgv. Only
per-Isolate/per-Environment options are allowed. Per-Process options
and V8 flags are not allowed. Passing an empty execArgv array will
reset per-Isolate and per-Environment options of the Worker to their
defaults. If execArgv option is not passed, the Worker will get
the same flags as the main thread.
Usage example:
```
const worker = new Worker(__filename, {
execArgv: ['--trace-warnings'],
});
```
PR-URL: https://github.com/nodejs/node/pull/25467
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/node_worker.h')
-rw-r--r-- | src/node_worker.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/node_worker.h b/src/node_worker.h index cbd4a86157..dd054ac38d 100644 --- a/src/node_worker.h +++ b/src/node_worker.h @@ -12,7 +12,10 @@ namespace worker { // A worker thread, as represented in its parent thread. class Worker : public AsyncWrap { public: - Worker(Environment* env, v8::Local<v8::Object> wrap, const std::string& url); + Worker(Environment* env, + v8::Local<v8::Object> wrap, + const std::string& url, + std::shared_ptr<PerIsolateOptions> per_isolate_opts); ~Worker(); // Run the worker. This is only called from the worker thread. |