Short question: When looking at the Channel and Actor examples, they seem to be written with a diferent style than the “use sequences for unbounded lists of stuff” philosophy.
CoroutineScope.filter example - it has a
for (x in myReceiveChannel)...
Should/Could these use Sequences? Are sequences for a different class of problem, or are channels and sequences frenemies - two competing ways to deal with creating, processing, and consuming stuff?
I’m consuming frames from a saved video, merging large groups of them, and writing them back out. I’d like it to
- Not die with an OOM (so no unbounded memory consumption with too many frames read before processing them, which is a problem I have with coroutines, and am hoping to solve with bounded capacity producers. )
- Be fast (run as much in parallel as possible, while preserving frame order) which I’m holing to get for free with the new coroutine context best-practices.
- Be Kotlin 1.3 correct: y’all concerning me that the consumerEach example is @ObsoleteCoroutinesApi
I also found https://stackoverflow.com/questions/45368353/bridge-channel-to-a-sequence which doesn’t work with 1.3, which heightens the impression of “these are two different strategies.”