Git Product home page Git Product logo

coroutine-first's Introduction

协程往事

根据asyncio制作了asynciox,并提供sleep方法,尽量不修改源代码的结构,asynciox支持本地运行和调试

start

python main.py

asynciox使用

from asynciox.base_eventx import BaseEventLoop
from asynciox.taskx import gather, sleep

async def req1(loop):
    await sleep(1, loop=loop)
    return 1
async def req2():
    return 2

async def main(loop):
    res = await gather(req1(loop), req2(), loop=loop)
    print(res)

if __name__ == '__main__':
    loop = BaseEventLoop()
    BaseEventLoop().run_until_complete(main(loop))

More

  1. yield解读

  2. yield from解读

  3. async解读

  4. await解读

  5. 让出控制权之yield流程

  6. 让出控制权之async流程

  7. 协程并发之yield from流程

  8. 协程并发之await流程

  9. asyncio 源码解读

  10. asyncio 体验

  11. asyncio 实战

  12. yield from传递

  13. await传递

🎀 🎀 读后有收获可以作者喝咖啡:

coroutine-first's People

Contributors

relax-admin avatar xiaoxinmiao avatar

Watchers

 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.