| ▲ | conartist6 6 hours ago | |
Yeah that problem you have is pretty much what I'm offering a solution to. It's the same thing you're already doing but more robust. Also I'm curious why you say that generators are far too slow. Were you using async generators perhaps? Here's what I cooked up using sync generators: https://github.com/bablr-lang/stream-iterator/blob/trunk/lib... This is the magic bit: | ||
| ▲ | conartist6 5 hours ago | parent [-] | |
You know now that I look at it I do think I need to change this code to defend better against multiple eager calls to `next()` when one of them returns a promise. With async generators there's a queue built in but since I'm using sync generators I need to build that defense myself before this solution is sound in the face of next();next(). That shouldn't be too hard though. | ||