3 ms·
I started using async generators years ago and using for-await-of loops to consume streaming data and be guaranteed that the processing order is maintained when
by jongjong 4y ago
I started using async generators years ago and using for-await-of loops to consume streaming data and be guaranteed that the processing order is maintained when there are async operations to be performed on each chunk of data. It's difficult to do in any other way; you'd need some kind of queue structure which would make code very difficult to read.