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

myanmarking

05/29/2020, 3:24 PM
hello.currently, is there any way i can use callback flow in which i can call a suspend function in awaitClose ?
d

Dominaezzz

05/29/2020, 3:53 PM
You can place your suspending code after
awaitClose
. (You'll probably want to slap in a `try`/`finally`). You could also use
onCompletion
instead or roll your own version of
awaitClose
that makes the lambda as suspending.
m

myanmarking

05/29/2020, 3:55 PM
hm. i'll give it a try. thanks
5 Views