If we want our Flows to run on multiple coroutines...
# feed
d
If we want our Flows to run on multiple coroutines, it might be tempting to just call
emit()
within a
launch {}
block. But because of context preservation, we can't do that. In today's 10-minute video, we'll see what context preservation is, why it's important, and how we can properly get our emitters and collectors to run on different coroutines.

https://youtu.be/9d8vTHzOvxE

👍 3
K 6
y
It's a very annoying gotcha with Flows. I hope that the work on Local Lifetimes will result in having compile-time guarantees about context preservation.
😀 1
d
@Youssef Shoaib [MOD] That's fantastic - I'll look forward to seeing what Ross has to say about that one! Compile-time guarantees for this would be really cool.