The focus of this chapter has been removing obtrusive concurrency semantics from our code. It simply raises the likelihood of our application's success because we'll have code that's easy to maintain and build upon. The first issue that we tackled was writing concurrent code by making everything concurrent. When there's no guesswork involved, our code is consistent and less susceptible to concurrency bugs.
Then, we looked at various approaches we can take to abstract web worker communication. Helper functions are one option and so is extending the postMessage()
method. We then addressed some of the limitations of web workers when we need our UI to be responsive. Even though our large dataset is processed faster, we still have the issue of updating the UI. This is done by treating web workers as generators.
We don't have to write all these JavaScript parallelization tools ourselves. We spent some time looking at the various capabilities and limitations of the Parallel.js
library. We...