Git Product home page Git Product logo

coroutines's Introduction

Coroutines

image

更新日志

8月26号

优化代码:
    1.添加弱引用例子,解决协程会导致的内存泄露问题

8月24号

优化代码: 
    1. 添加合理的线程池 为协程作为上下文 
    2. 将协程函数标记为内联函数提高性能

kotlin 协程封装计划安排

    1.  顺序执行 task1,task2
    2. 并发执行 task1,task2
    3. 等待执行 task2 需等待 task1执行完毕后执行
    4. 延迟执行 task1 需要10秒之后执行
    5. 心跳执行 异步任务按指定间隔执行 Task 
    6. 任务执行感知生命周期,可以跟随当前activity的生命周期结束而自动结束,并可以配置是否在重新打开activity时是否要重新执行
    7. 任务执行可选主线程还是子线程
    8. 任务执行可以选择 需要网络或者不需要网络
    9. 任务执行可以选择网络制式4G 或者wifi下执行(5.0以上特性)
    10.任务可以选择在充电时执行(5.0以上特性)
    11. 任务执行可以随时取消,可以取消所有当前任务

项目介绍地址

例子 描述
协程简单封装 主要包含对协程的顺序执行,并发执行,还有等待执行的封装的例子,以及如何延迟,如何切换android UI 线程
协程实现防止按钮多次点击 主要用到actor协程,实现无通道Channel的处理

coroutines's People

Contributors

ibaozi-cn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.