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

Paul Woitaschek

10/30/2018, 9:03 PM
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

louiscad

10/30/2018, 9:45 PM
@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

Vsevolod Tolstopyatov [JB]

10/31/2018, 10:01 AM
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
4 Views