https://kotlinlang.org logo
#announcements
Title
# announcements
t

tseisel

06/16/2019, 9:55 AM
What do you think of using coroutines
BroadcastChannel
for that purpose ? https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.channels/-broadcast-channel/index.html You publish with
Copy code
channel.send(event)
Multiple consumers can subscribe with
Copy code
channel.consumeEach { event ->
    // Handle the event
}
f

farzad

06/16/2019, 10:51 AM
Actually
BroadcastChannel
is what I need. But as you may know, it's experimental yet and might have breaking changes in the future.
t

tseisel

06/16/2019, 1:22 PM
You may stick with Rx `PublishSubject`/`PublishProcessor` for now, it is roughly equivalent
f

farzad

06/16/2019, 2:16 PM
Yeah, it seems to be the best available option for me. Thanks.
4 Views