https://kotlinlang.org logo
Title
d

dimsuz

01/31/2020, 4:36 PM
Coroutine/KMPP question: what are my options if I want to send to the ConflatedBroadcastChannel from swift? Usecase: on button click in UI I want to send this click to the channel. But
send
is a suspending function and as such not usable from Swift/ObjC. Are there docs about this which I've missed? I see a lot of tutorials for iOS concurrency, but a little about this kind of interop. Not sure if this is the right channel as it is both about #coroutines and #multiplatform
a

audriusk

01/31/2020, 4:54 PM
offer
method is not suspending. Also I don't think it's good idea to expose
ConflatedBroadcastChannel
to UI. Its seams more like implementation detail for state management. After a year you might want to change to something else then
ConflatedBroadcastChannel
and then all UI will have to be refactored.
d

dimsuz

01/31/2020, 5:00 PM
yes I may wrap that in an interface.
offer
seems to be what I needed, how could I miss that? Thanks )