3 ms·
I've been a huge fan of webworkers in theory, but I've hated implementing them. The (until recent) lack of module support was one problem, but just getting it a
by jhunter1016 6y ago
I've been a huge fan of webworkers in theory, but I've hated implementing them. The (until recent) lack of module support was one problem, but just getting it all set up, talking to the main thread, etc—it was all so daunting. This looks promising, though!
- tobiu 6y agoHa, I know the feeling. Rich & I started with the workers implementation back in 2015. No console errors ;) What was a huge help is the remotes API (remote method access). example: https://github.com/neomjs/neo/blob/dev/src/main/addon/Stylesheet.mjs#L25 https://github.com/neomjs/neo/blob/dev/src/main/addon/Styles... createStyleSheet() is defined inside this class which (optionally) runs inside the main thread and is exposed as a remote method to the App worker. Now, when you are working inside the App worker scope, you can simply use it as a promise: Neo.main.addons.Stylesheet.createStyleSheet(opts).then(data) { // do something }