Home Page Icon
Home Page
Table of Contents for
Cover
Close
Cover
by Caleb Hattingh
Using Asyncio in Python 3
Preface
1. Introduction
The Restaurant of ThreadBots
Epilogue
What Problem Is Asyncio Trying to Solve?
2. The Truth About Threads
Benefits of Threading
Drawbacks of Threading
Case Study: Robots and Cutlery
Discussion
3. Asyncio Walk-Through
Quickstart
The Tower of Asyncio
Summary
Coroutines
The New async def Keyword
The New await Keyword
Event Loop
Tasks and Futures
Create a Task? Ensure a Future? Make Up Your Mind!
Async Context Managers: async with
The contextlib Way
Async Iterators: async for
Async Generators: yield Inside async def Functions
Async Comprehensions
Starting Up and Shutting Down (Gracefully!)
What Is the return_exceptions=True for?
Signals
Waiting for the Executor During Shutdown
Testing with asyncio
4. 20 Asyncio Libraries You Aren’t Using (But…Oh, Never Mind)
Streams (Standard Library)
Case Study: A Message Queue
Case Study: Improving the Message Queue
Twisted
The Janus Queue
aiohttp
Case Study: Hello World
Case Study: Scraping the News
ØMQ (ZeroMQ)
Case Study: Multiple Sockets
Case Study: Application Performance Monitoring (APM)
asyncpg and Sanic
Case Study: Cache Invalidation
Other Libraries & Resources
5. Concluding Thoughts
6. Appendix
Short History of Async Support in Python
In the Beginning, There Was asyncore
The Path to Native Coroutines
Cutlery Example Using Asyncio
Supplementary Material for News Website Scraper
Supplementary Material for the ZeroMQ Case Study
Database Trigger Handling for the asyncpg Case Study
Supplementary Material for the Sanic Example: aelapsed and aprofiler
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Next
Next Chapter
Using Asyncio in Python 3
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset