-
Notifications
You must be signed in to change notification settings - Fork 33
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
Getting a failure under node #23
Comments
Interesting, I'll have to take a look at it here soon. The issue appears to be that Node doesn't like using I'd suggest trying to use a 3rd party web worker implementation as well, something like this might help you get started before I can address this as its an issue with the legacy fallback mode that doesn't actually use threads. https://www.npmjs.com/package/webworker-threads Node doesn't ship with a native web worker implementation out of the box so the library is defaulting to the fallback mode in your case. If you make use of a third party implementation be sure to import that BEFORE you import hamsters. |
Hey Austin! Thanks for looking at this... I'm not in a particular hurry
right now, so I'll be interested to see what you find.
…On Sun, Feb 19, 2017 at 9:59 AM, Austin Smith ***@***.***> wrote:
Interesting, I'll have to take a look at it here soon. The issue appears
to be that Node doesn't like using self as a shortcut to the global
scope, typically self.blah would be the same as global.blah or window.blah
so node is doing something weird.
I'd suggest trying to use a 3rd party web worker implementation as well,
something like this might help you get started before I can address this as
its an issue with the legacy fallback mode that doesn't actually use
threads. https://www.npmjs.com/package/webworker-threads
Node doesn't ship with a native web worker implementation out of the box
so the library is defaulting to the fallback mode in your case. If you make
use of a third party implementation be sure to import that *BEFORE* you
import hamsters.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACUHYscTUC5g4BoKx9J1y7FYf7O5M6lks5reFjLgaJpZM4MFKpC>
.
|
@csterritt Try using the latest from dev branch now, just pushed this commit which should fix the issue. I haven't tested it yet but it looks like it'll work. |
@csterritt Please let me know if that resolved your issue if you get the chance, thanks |
Hi Austin,
Will do - it may be a week or so, I'm traveling now.
…-- chris
On Feb 23, 2017, at 1:24 PM, Austin Smith ***@***.***> wrote:
@csterritt Please let me know if that resolved your issue if you get the chance, thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@csterritt No problem, I'm going to go ahead and close this issue out. I went ahead and published v3.9.8 which includes this fix. If you have anymore issues feel free to open another ticket, thanks! https://github.com/austinksmith/Hamsters.js/releases/tag/v3.9.8 |
Sorry to be 'that guy', but I'm getting a new problem with v3.9.8. It fails the same way under node v4.3.2 and v7.7.0:
|
No problem, that's why I asked you to follow up haha. So it looks like I mixed up the order during the environment setup so currently the v3.9.8 will only work with a 3rd party web worker implementation (which is what you'll want for real threading). I'll push a fix today that will restore the legacy fallback mode which will allow you to write your logic and take advantage of the async nature of the library but will not give you the performance benefits you're probably looking for with extra threads. |
As promised, this should resolve your issues. Runkit on npm hasn't updated yet but i think this will work. https://github.com/austinksmith/Hamsters.js/releases/tag/v4.0.0 |
Alas:
Also, which 3rd party web worker implementation do you recommend? |
Hmm, so I actually published version 4.0 which resolves the issue you're talking about already. I see on the npmjs.com page that it shows version 4.0 is what you should see. This however looks like version 3.9.9. |
I put in a support ticket with them to get the website to update the package, sorry about that. Regarding web worker implementations, this one looks fairly good. I will warn however that their example documentation isn't what you probably want here. You'll probably need to do something like this.
Then you can just use Hamsters like you usually would. If you get an error that Worker doesn't exist..then do what their documentation says and assign a global variable to assign
|
Hey Austin - glad to report that 4.0 works fine! I haven't gotten it working with webworker-thread yet, but I'm sure that will come. Thanks again for your help! |
Hello,
Trying the fourth test function under node.
However, I'm compiling from ES6, so I've switched the
function
s to arrow functions:This fails with the following error:
This is using node v4.3.2 (for compatibility reasons).
Any clues? Thanks!
The text was updated successfully, but these errors were encountered: