tl;dr
Web Workers are awesome and Angular CLI now supports them natively.
Unfortunately, the Web Worker API is not Angular-like and ther...
For further actions, you may consider blocking this person and/or reporting abuse
FYI: you link to the NPM package several places in the article, but the
package.json
is apparently missing a link to the associated git repo.I can't speak for everyone obviously, but I have no interest in npmjs.org links. I only use them to find the associated git repo. For anyone else looking for the git repo, you can find it here: github.com/cloudnc/observable-webw... (the last link in the article references it).
(also, thanks for open-sourcing your work! Looks super useful)
Thanks for the tip John, I have actually already fixed this however it hasn't been released due to the semantic release program computing the change was immaterial and didn't warrant a version bump, so this fix will go out with the next addition to the library. I'll see if there is anything obvious I can fix up to ensure it gets out as this is kinda annoying I agree.
Dunno what your pipeline is, but I remember running into something like this with lerna and I was able to make use of an option (
--force
?--force-publish
?) to force out an otherwise identical patch release.This sounds great Zak, thanks for sharing!
I'm confused though. I think I followed these steps right, but the worker threads aren't being terminated. Did I miss something? github.com/bboyle/observable-workers
seems to be the version of observable-workers. I see the worker threads being terminated if I use version 3.0.1. doesn't seem to be an issue with the advanced blog posts
You have to explicitly call subscription.unsubscribe() in order for the workers to be torn down. In other words, this:
Really needs to be this:
Just went through this helpful introduction. As of 2022, there seem to be just a few differences to highlight:
ObservableWorker
has been deprecated.runWorker
is intended to replace it, like this:fromWorker
. It will terminate those workers when the subscription is unsubscribed (not just when the observable emits Complete). So this code:Should really be this code:
I would love to know more about the inner workings. Btw you and maxime1992 always seem to ask the same question I research. Thank you for all the public info you output
Man, You can't possibly know how happy I am to see this library. Going to try it over the weekend and on next week possibly in a project where I am currently performance optimizing.
Looks really nice and interesting. Im definitely going to give it a look.
Well done !!!
Thanks for sharing!!!
Excellent post. Can you please include, either at the top or bottom (or both), a link to the follow-up article?
Thanks!
Hey Manual, thanks for the support! DEV now automagically adds this to the beginning of all articles that are marked as a part of a series :)