Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Daniel Arbuckle???s Mastering Python

You're reading from   Daniel Arbuckle???s Mastering Python Build powerful Python applications

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781787283695
Length 274 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Daniel Arbuckle Daniel Arbuckle
Author Profile Icon Daniel Arbuckle
Daniel Arbuckle
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Python Primer FREE CHAPTER 2. Setting Up 3. Making a Package 4. Basic Best Practices 5. Making a Command-Line Utility 6. Parallel Processing 7. Coroutines and Asynchronous I/O 8. Metaprogramming 9. Unit Testing 10. Reactive Programming 11. Microservices 12. Extension Modules and Compiled Code

Coroutines and Asynchronous I/O

In the previous chapter, we looked at how to use multiple processes to increase the rate of data processing in our programs. This is great for CPU-bound programs because it allows them to use more than one CPU.

In this chapter, we'll look at the inverse of this case; we'll use a single CPU to handle multiple data processing tasks at once within a single process, which is great for I/O-bound programs. We'll see some of the nuts and bolts of working with asyncio. We'll also discuss asyncio's future class and how it's used. Then we'll move on to synchronization and communication between asynchronous coroutine tasks. Lastly, we'll see how to use asyncio and coroutines to write a client-server program to communicate over a network.

We will cover the following topics:

  • The difference between asynchronous processing...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at R$50/month. Cancel anytime