There is so much demand for multicasting/sharing s...
# coroutines
z
There is so much demand for multicasting/sharing support in Flow. Libraries like dropbox/store have their own inline implementations. There are tons of gists of implementations posted on the various coroutine issues. I haven’t seen any libraries published on maven for this though. Has anyone factored any of these out into a library? We’re starting to consider moving from RxJava to Flow in some of our larger codebases and would like to use existing libraries for stuff like this instead of copy/pasting or writing our own implementation of stuff.
n
Dropbox publishes multicast into it's own artifact. https://mvnrepository.com/artifact/com.dropbox.mobile.store/multicast
z
oh i missed that, thanks!
👍 1
b
I thought I needed a multicast operator and ended up just exposing a channel and calling
asFlow
whenever I need to multicast. Just need to be careful to cancel the channel when appropriate. What are the features from Rx multicasting that you need and for which purpose?
z
A variety of things – typical use case is an object with its own lifetime that injects various service objects that vend `Flow`s, needs to combine those into its own
Flow
, and vend that. The object’s lifetime manages the upstream subscriptions, so we use `replay(1)`/`publish()` with manual
connect
a lot.