I don't know why, but last time I looked, but turn...
# coroutines
d
I don't know why, but last time I looked, but turning a callback into coroutines is in the internals KEEP doc. on github kotlinx.coroutines, not in the guide there...
m
what is the doc?
g
kotlin-coroutines
official specification and docs. Make sense do not put everything to kotlinx-coroutines, because it's library, not tutorial how to write coroutine libraries
d
Right, but KEEP is usually spec docs for planning features and explaining internals, not end user documentation... which gives the feeling that
suspendCoroutine
is a low level api not to be used, whereas in reality, I think that it's the best way to turn callbacks into
suspend fun
... a few people asked this, so it seems like either they didn't see the docs, or its not so obvious....
g
But this is end user documentation. Yes, it’s low level stuff and should be low level, because writing coroutines libraries is low level task There is section about wrapping callbacks https://github.com/Kotlin/kotlin-coroutines/blob/master/kotlin-coroutines-informal.md#wrapping-callbacks
But now I’m thinking that kotlinx-coroutines should have a separate section about wrapping callbacks. because provides more high level API for that with support of cancellation
d
That's exactly my point simple smile
g