Python 3 Asynchronous Programming异步编程简单入门

  • 4.4
  • (140+ reviews)

Description

python由于GIL(全局锁)的存在,不能发挥多核的优势,其性能一直饱受诟病。然而在IO密集型的网络编程里,异步处理比同步处理能提升成百上千倍的效率,弥补了python性能方面的短板,如最新的微服务框架japronto,resquests per second可达百万级。

 

python还有一个优势是库(第三方库)极为丰富,运用十分方便。asyncio是python3.4版本引入到标准库,python3.5又加入了async/await特性。

以下PEP是本课程的参考资料:

  • PEP 255 — Simple Generators

  • PEP 342 — Coroutines via Enhanced Generators

  • PEP 380 — Syntax for Delegating to a Subgenerator

  • PEP 492 — Coroutines with async and await syntax

  • PEP 525 — Asynchronous Generators

从这些 PEPs 中可以看出 Python 生成器 / 协程的发展历程:先是 PEP 255 引入了简单的生成器;接着 PEP 342 赋予了生成器 send() 方法,使其可以传递数据,协程也就有了实际意义;接下来,PEP 380 增加了 yield from 语法,简化了调用子生成器的语法;然后,PEP 492 将协程和生成器区分开,使得其更不易被用错;最后,PEP 525 提供了异步生成器,使得编写异步的数据产生器得到简化。


本课程就是从最基本的yield语法开始,让大家了解协程和异步背后实现的机理,然后再讲解asyncio的基本的语法,从而让大家对异步和asyncio有深入的理解。

Course Info

Created by Peng Xiao
37 minutes on-demand video
9 lectures
6,403+ students enrolled
4.4 rating from 140+ reviews
Simplified Chinese language
Created on August 26, 2018
Category: Development
Subcategory: Programming Languages

Ad

Share this course:

Frequently Asked Questions

  • How long is a coupon valid?

    Coupons are issued by instructors to promote their courses, gain traction and reach momentum. The instructor can choose to emit discounted (ex: $11.99 coupon) or 100% off coupon (you pay nothing). Each coupon becomes expired when emitted quota is over (1000 enrollments) OR expiration date has been reach (5 days).

  • What is this "1000 enrollments" from Udemy?
  • Could you please help me to find a coupon for this course?
  • What is exactly your relationship with Udemy?

© 2021–2025 INFOGNU — Made with ❤️ for the World.