dave08
03/17/2020, 2:42 PMasFlow() on a closed ConflatedBroadcastChannel will it receive the latest element sent before it was closed, or will the flow be empty?elizarov
03/17/2020, 2:56 PMdave08
03/17/2020, 4:03 PMelizarov
03/17/2020, 4:04 PMdave08
03/17/2020, 4:08 PMdave08
03/17/2020, 4:09 PMasFlow(), so if I close the channel, it won't receive them... if I don't the UI will keep on listening to an invalid channel...elizarov
03/17/2020, 4:14 PMdave08
03/17/2020, 4:18 PMlaunch a coroutine to listen to the changes it will report... wouldn't those coroutines just pile up and just waste memory as new ones come in that are more relevant?dave08
03/17/2020, 4:19 PMelizarov
03/17/2020, 4:20 PMdave08
03/17/2020, 4:21 PMdave08
03/17/2020, 4:21 PMelizarov
03/17/2020, 4:23 PMdave08
03/17/2020, 4:58 PMcancel(someException) or close(someException) will a catch { } on the Flow resulting from asFlow() catch it, or will it throw (since anyways those emissions are really a final state anyways...)?dave08
03/17/2020, 5:03 PMfun getDownloadListener() = downloadBroadcastChannel.asFlow().catch {
when(it) {
is ExceptionOne -> emit(StateOne())
....
}
}
and reuse that ...dave08
03/17/2020, 5:04 PMdave08
03/17/2020, 5:04 PMdave08
03/17/2020, 5:06 PM