Advanced JavaScript Scheduling and Interleaving with Generator Functions

If you ever tried to fit a long-running JavaScript function into a frame budget, you know how short 50 milliseconds can be. You probably had to break up your function into smaller sub-functions and then find some way to throttle the sub-functions' calls. The result was probably a huge mess of spaghetti callbacks that was hard to read and almost impossible to reason about. But with recent additions to both JavaScript and the DOM standard there are in fact better ways to split and throttle your long-running functions!

This talk introduces a new, zero-dependency technique for scheduling large blocking operations in JavaScript using generator functions. Break up long-running tasks into smaller chunks that fit into your frame budget without compromising readability or testability of your code!


Peter Kröner

Frontend specialist, long-time teacher, veteran of dry specifications and buggy browsers, Erklärbär More...