Chapter 27APIs: Web Workers
are single-threaded in nature. Some of you might say
that you have run tasks asynchronously in the past using functions like
setInterval, and our
XMLHttpRequest. But, in reality, those
tasks run one after the other and are queued accordingly. Web Workers offer
us a multi-threaded environment where multiple
threads can execute in parallel, offering true concurrency.
In this chapter, we’ll first discuss the purpose and how to use Web Workers, before having a look at some ...