随笔分类 -  kotlin协程

摘要:2.6.0时retrofit支持了kotlin的suspend, retrofit的代码是怎么识别一个方法时suspend函数的呢? private suspend fun testSuspend(key: String, age: Int) { withContext(Dispatchers.De 阅读全文
posted @ 2022-01-04 13:16 嘤嘤嘤123 阅读(342) 评论(0) 推荐(0)
摘要:参考 https://developer.android.com/kotlin/coroutines https://www.bennyhuo.com/2019/05/27/coroutine-android/ https://juejin.im/post/6854573211418361864 导 阅读全文
posted @ 2020-11-09 16:01 嘤嘤嘤123 阅读(1782) 评论(0) 推荐(0)
摘要:参考 https://www.bennyhuo.com/2019/05/07/coroutine-suspend/ 深入协程挂起 从下边的函数说起; public suspend inline fun <T> suspendCancellableCoroutine( crossinline bloc 阅读全文
posted @ 2020-11-09 15:54 嘤嘤嘤123 阅读(936) 评论(0) 推荐(0)