DEV Community

Discussion on: JavaScript Concurrency: Avoiding the Sequential Trap

Collapse
 
miketalbot profile image
Mike Talbot ⭐

I'd just like to add that I recently launched js-coroutines which seeks to split up sorts, stringifies, compression and your own heavy functions over multiple frames using coroutines and requestIdleCallback. It works pretty well for circumstances where worker threads are hard to achieve or just too much work for an edge case.

My article on how that works.

Collapse
 
somedood profile image
Basti Ortiz

Pretty neat! 👍

I think the pattern of offloading state computations to background threads is great for highly interactive applications.

In particular, I'm sure many game developers in the Web space will find your library quite useful.