|
|
|
|
|
by joeycumines
963 days ago
|
|
Yep, JS is still single threaded, and all that. I agree async iteration is pretty good - the `Chan` class implements both `Iterable` and `AsyncIterable`. For quite a few scenarios, async generators are a better choice. They do have limitations, however. For example, you _can_ implement fan-in, but there's no easy mechanism to fan-in in a blocking manner, from sources that aren't known ahead of time. It's also hard to implement a "fair" mechanism, that doesn't bias certain inputs (like you might desire if multiplexing logs, for example). |
|