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

Calling from a Web Worker #12

Open
gungorbudak opened this issue Nov 22, 2015 · 0 comments
Open

Calling from a Web Worker #12

gungorbudak opened this issue Nov 22, 2015 · 0 comments

Comments

@gungorbudak
Copy link

Hi!

I'm using web workers for multi-threaded way of analyzing my data on the browser and I need to do some statistical tests with calls using OpenCPU. However, my first attempts to import it to a web worker didn't work. Since, there is no window or document object in a web worker, I tried to set them to self but jQuery complains about the document object.

// worker.js
var window = self,
    document = self;
importScripts('libs/jquery-1.11.3.js', 'libs/opencpu-0.4.js');
ocpu.seturl("//public.opencpu.org/ocpu/library/base/R");
Uncaught TypeError: Cannot read property 'createElement' of undefined jquery-1.11.3.js:930

Seeing that there are no JS libraries with such tests as in R, I think OpenCPU is the only way to do statistical computation on a browser.

This is actually a jQuery error but I just wanted to bring it to your attention. Any help about calling R code from the worker threads will be appreciated.

Thanks

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

1 participant