When converting a listener to a channel is there a...
# coroutines
p
When converting a listener to a channel is there a better way than creating a channel inside produce and then iterating it like here? https://github.com/Beepiz/BleScanCoroutines/blob/master/core/src/main/java/com/beepiz/bluetooth/scancoroutines/experimental/BleScanner.kt#L44
l
@Paul Woitaschek Now, you can use
invokeOnClose
. I'm planning to improve this library when streams and alike APIs arrive in coroutines though. Right now current channels APIs is about to become obsolete
v
Channel API will not become obsolete 🙂 Channel is a good abstraction for hot-streams and suspending queue-like structures.
We rather deprecate all API which tries to use channels as cold streams