https://kotlinlang.org logo
#coroutines
Title
# coroutines
o

obobo

06/24/2021, 6:06 PM
I'm thinking about building a flow around a kafka consumer; problem is that the consumer only allows me to call its methods from a single thread. I was able to implement this using coroutines fired by a single-threaded dispatcher and communicating via channels. But for a Flow-centered solution I build a flow using the
flow{}
builder, can I somehow guarantee that the code in the
flow{}
will run inside a specific dispatcher but the code that collects the results sent by `emit()`will run in a less-restricted dispatcher?
k

knthmn

06/25/2021, 1:48 AM
2 Views