-
Notifications
You must be signed in to change notification settings - Fork 145
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
Implement support for a blob url instead of a path #23
Comments
Thanks for the suggestion. I guess you mean to send a script containing functions instead of passing the url of a script. A single function can already be executed in a worker easily without even having to stringify it (see docs). |
Thanks! |
Why do you close the issue? Do you only need passing a single function? |
The |
ah ok perfect! let's keep it closed then. If anyone is interested in passing a complete script as string we can reopen this issue. |
Actually, I think I got confused. This is what I'd originally requested: workerpool.pool("data:application/javascript;utf-8,(function(){…})()") so that we don't need to have a separate "workerpool.js" file |
Yes exactly, so you can bundle your worker file in the main file and load it as a string. That can be useful I think. |
See also #46 (duplicate) |
I've created an example on creating an embedded worker using a data URL, that works out of the box already: https://github.com/josdejong/workerpool/tree/master/examples/embeddedWorker Support for data URL's in node.js requires work. |
similar to function-thread.
If you use the
vm
module, it already takes a string. As forWorker
, you could use a data-url.The text was updated successfully, but these errors were encountered: