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

从基本概念和底层原理带您入门Python 3异步编程

4.95 (160 reviews)
Udemy
platform
中文
language
Programming Languages
category
instructor
Python 3 Asynchronous Programming异步编程简单入门
7,253
students
37 mins
content
Mar 2019
last update
FREE
regular price

What you will learn

了解异步编程的基本概念

关于并发,并行,同步,异步等基本概念

如何实现协程,事件驱动

asyncio的基本语法

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有深入的理解。

Content

Introduction

Introduction
注意:学习本课程前,请确保您已经有Python基础
欢迎大家关注我的YouTube Channel
课程源码source code
几个概念的澄清
什么是coroutine呢?
实现一个event loop task manager
asyncio的语法demo
结语
bonus: 更多课程欢迎大家学习

Reviews

Sean
November 11, 2020
推薦!如果有想學進階多線程&多進程編程的人,實在值得來看一下。 可以知道一些重要的名詞,比如yield / generator / coroutine / asynio套件 / eventloop方法等,以此去google補足基礎觀念。 此外,因爲是免費的課程,所以時間長度短也大概是必然的。
Zheng
August 29, 2018
1. Can anyone explain what is the purpose for "assert yielded is None" in Taskschuduler • run_to_completion method in else: block? will this assertion lead to unhandled error? else : assert yielded is None self.runnable_tasks.append(task) Will the instructor give me some clue on that? 2. I doubt if the taskschduler actually make all the task queue to be sync , instead of async? My understanding could be wrong. 3.Anyway, great lecture, very insightful. Thumbs up for the instructor.

Charts

Price

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

Rating

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

Enrollment distribution

Python 3 Asynchronous Programming异步编程简单入门 - Distribution chart
1877258
udemy ID
8/26/2018
course created date
7/16/2019
course indexed date
Bot
course submited by