Environmental assumptions

  1. > = Python 3.5
  2. Linux

advantage

  1. This function is abnormal for asynchronous I/O tasks
  2. Programming model is simpler and less burdensome:
    1. Get an Event loop using Asyncio
    2. And then we plug something into this loop (coroutine)
  3. The operating system still sees single threading, but from a macro perspective it sees “multi-concurrency” (every language is pretty much like this: implementing a multi-threaded model in user mode).

disadvantages

  1. The ecology is immature (although there is AIO-Libs), and it would be nice if libraries like Requests had corresponding implementations (and high popularity)
  2. There is a premise that an App must be asynchronous from front to back, which is burdensome for many legacy projects

Contrast with GEvent + Python 2

  1. Many projects are Python 2 based, and using gEvent is very effective
  2. The only worry is that gEvent will have a lot of patches (hack standard library), and what we see is a black box
  3. Gevent is not necessarily less efficient than Asyncio + Async def

(Actually, I’m a little fan of GEvent. Our project uses gEvent a lot and the effect is quite good. Why not use it?)

How to use

  1. Asyncio as our framework (I prefer what the standard library has) and async def/await as the basic design tool
  2. Use the various libs in AIO-Libs (asynchronous from start to finish!)