Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Python Networking - Fourth Edition

You're reading from  Mastering Python Networking - Fourth Edition

Product type Book
Published in Jan 2023
Publisher Packt
ISBN-13 9781803234618
Pages 594 pages
Edition 4th Edition
Languages
Concepts
Author (1):
Eric Chou Eric Chou
Profile icon Eric Chou

Table of Contents (19) Chapters

Preface 1. Review of TCP/IP Protocol Suite and Python 2. Low-Level Network Device Interactions 3. APIs and Intent-Driven Networking 4. The Python Automation Framework – Ansible 5. Docker Containers for Network Engineers 6. Network Security with Python 7. Network Monitoring with Python – Part 1 8. Network Monitoring with Python – Part 2 9. Building Network Web Services with Python 10. Introduction to Async IO 11. AWS Cloud Networking 12. Azure Cloud Networking 13. Network Data Analysis with Elastic Stack 14. Working with Git 15. Continuous Integration with GitLab 16. Test-Driven Development for Networks 17. Other Books You May Enjoy
18. Index

Asynchronous Operations Overview

In the ‘Zen of Python,’ we know one of the guiding principles in Python is to preferably have ‘one best way to do something.’ When it comes to asynchronous operations, it is a bit complicated. We know it would help if we could do multiple tasks simultaneously but determining the correct solution might not be straightforward.

First, we will need to determine what is slowing down our program. Typically, the bottleneck can be either CPU-bound or IO-bound. In a CPU-bound situation, the program pushes the CPU to its limit. Operations such as solving mathematical questions or image processing are examples of CPU-bound programs. For example, when we pick an encryption algorithm for VPN, we know the more complex the algorithm, the more CPU it would consume. For CPU-bound tasks, the way to mitigate the bottleneck is to increase the CPU power or allow the task to use multiple CPUs simultaneously.

In an IO-bound operation, the program...

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 $15.99/month. Cancel anytime}