协程
赵小龙_同学
这个作者很懒,什么都没留下…
展开
-
协程相关博文
Kotlin 协程入门这一篇就够了https://juejin.im/post/5d0afe0bf265da1b7152fb00 Kotlin 的协程用力瞥一眼https://kaixue.io/kotlin-coroutines-1/原创 2019-11-17 13:38:52 · 96 阅读 · 0 评论 -
协程在Retrofit上的使用
前情提要:很简单的用法,没啥可补充的,英文也很简单,自己看吧。Suspend what you’re doing: Retrofit has now Coroutines support!It official now!Retrofit 2.6.0has been released with support for suspend functions.This allows...原创 2019-11-17 11:39:00 · 1842 阅读 · 1 评论 -
Coroutines On Android (part III): Real work(协程在Android上的使用三:真实案列)
前情提要:本文作者是谷歌公司的大牛,其实这一篇文章主要讲了如何用协程解决多线程并发的问题,有3中方法。1、是取消上一个任务;2、是排队执行任务;3、是重用上一个任务。非常值得看看。This is part of a multi-part series about using Coroutines on Android. This post focuses on solving pract...原创 2019-11-16 14:39:36 · 473 阅读 · 0 评论 -
Coroutines on Android (part II): Getting started(协程在Android上的使用二:开始)
前情提要:本文作者是谷歌公司的大牛,主要讲了结构化并发启动协程,以保证1、父作用域取消时,所有子作用域也会被取消;2、挂起方法返回时,里面的协程执行完毕;3、内部协程出错时,外部会得到通知。This is part of a multi-part series about using Coroutines on Android. This post focuses on starting...原创 2019-11-16 12:48:51 · 292 阅读 · 0 评论 -
Coroutines on Android (part I): Getting the background(协程在Android上的使用一、背景)
前情提要:本文作者是谷歌公司的大牛,主要介绍协程和callback背景介绍,值得看看。This is part of a multi-part series about using Coroutines on Android. This post focuses on how coroutines work and what problems they solve.Other art...原创 2019-11-15 16:45:44 · 319 阅读 · 0 评论 -
将kotlin协程和架构组件一起使用
前情提要:kotlin协程和架构组件一起使用,完全都不用自己care取消耗时任务执行的问题,真香。Use Kotlin coroutines with Architecture componentsKotlin coroutinesprovide an API that enables you to write asynchronous code. With Kotlin corouti...原创 2019-11-15 14:17:28 · 894 阅读 · 0 评论 -
Improve app performance with Kotlin coroutines(用协程提升App性能)
前情提要:谷歌官方文档,你应该读一读吧。其实协程不是像线程,应该是更像在线程池里执行任务,而且不用我们自己处理callback。Improve app performance with Kotlin coroutinesAcoroutineis a concurrency design pattern that you can use on Android to simplify co...原创 2019-11-15 11:13:18 · 568 阅读 · 0 评论