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

Using full Node scripts (Noob) #102

Closed
atcwells opened this issue Apr 22, 2016 · 1 comment
Closed

Using full Node scripts (Noob) #102

atcwells opened this issue Apr 22, 2016 · 1 comment

Comments

@atcwells
Copy link

Hi there,

I'm trying to 'require' a script within a WebWorker, and getting stuck. I think I understand the basics of why this doesn't work - i.e. that the new thread is not a native NodeJS thread and is instead a thread executing with a plain V8 context, but I'm just trying to confirm my suspicions:

            var Worker = require('webworker-threads').Worker;
            var worker = new Worker(function () {
                console.log(1);
                var exec = require('child_process').exec;
                console.log(2);
            });

I never get to '2'. I assume this is because the thread is breaking. Is there any native option here?

I think that the only way I'll acheive what I want is to become at least proficient at C++ and muck in, or to ask the Worker thread to start a subset of my main threads abilities and to share space across a data store of some sort, could anyone confirm?

Even then, I'm having problems running a file from my Worker, using 'require' within a second .js file causes the same breaking problem. Is this a continuation of #9?

Thanks,
Alex

@audreyt
Copy link
Owner

audreyt commented May 18, 2016

Yes, this is the same as #22 (not currently implemented).

@audreyt audreyt closed this as completed May 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants