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

Luis Munoz

10/22/2020, 6:55 PM
Anyone have an example of a producer and multiple worker consumer pattern using flow, shareIn?
l

louiscad

10/22/2020, 7:20 PM
shareIn
is not designed for that. Channels or custom constructs are better suited for this kind of use case (though you might still plug it to some flow(s)).
l

Luis Munoz

10/22/2020, 7:27 PM
I guess shareIn will send to all subscribers, there is no way to round robin to the subscribers
t

tseisel

10/23/2020, 6:57 AM
channel.receiveAsFlow()
should do the trick
1
2 Views