Sep 7, 2021
Benjamin Vincent the magic part is that the for..of loop on a generator just consumes elements as long as there exists something. Which worker consumes a certain output of the generator is not predictable but all workers end when there’s nothing more to consume. That is how the for..of loop works with generators. Hope it helps.