Completable 源码解析扩充 <二>

hi,comming again

LastYear I already writon those topic ,today I’m going talk it again and focus on async.

first of all ,you should understand the structure of Completable that I talked before ,then you should know how to iterate the structure on a thread.
then we’ll going to talk about how to iterate the structure on different thread.

here is the answear ,use pre-order to iterate Completable , if you want to use different thread ,once you iterate a node ,just let it run another thread ,then go back to it’s parent. that’s all.

if you want to know the details in code , just keep watching.

first , just let all node in a thread , if you want a node run in other thread ,when iterate that node , just check if the node have Execute, if had then ,let Execute to run it . then goback to the node’s parent ,and keeping research.

Second ,Execute will run the onde as async, so don’t need check if it in Async ,because it already Async.

Third, the onde run in other thread , just repeat first step,

Here is small little details should be added.

if one child node run in other thread , before it repeat step first ,will try to help run it’s parent node .

if you can understand all of them ,you will use function Async as many as possible ,and just make your ForkJoinPool work well.

that’all .thanks for reading.

  • 10
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值