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
Advanced Python Programming

You're reading from   Advanced Python Programming Build high performance, concurrent, and multi-threaded apps with Python using proven design patterns

Arrow left icon
Product type Course
Published in Feb 2019
Publisher Packt
ISBN-13 9781838551216
Length 672 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (3):
Arrow left icon
Quan Nguyen Quan Nguyen
Author Profile Icon Quan Nguyen
Quan Nguyen
Sakis Kasampalis Sakis Kasampalis
Author Profile Icon Sakis Kasampalis
Sakis Kasampalis
Dr. Gabriele Lanaro Dr. Gabriele Lanaro
Author Profile Icon Dr. Gabriele Lanaro
Dr. Gabriele Lanaro
Arrow right icon
View More author details
Toc

Table of Contents (41) Chapters Close

Title Page
Copyright
About Packt
Contributors
Preface
Benchmarking and Profiling FREE CHAPTER Pure Python Optimizations Fast Array Operations with NumPy and Pandas C Performance with Cython Exploring Compilers Implementing Concurrency Parallel Processing Advanced Introduction to Concurrent and Parallel Programming Amdahl's Law Working with Threads in Python Using the with Statement in Threads Concurrent Web Requests Working with Processes in Python Reduction Operators in Processes Concurrent Image Processing Introduction to Asynchronous Programming Implementing Asynchronous Programming in Python Building Communication Channels with asyncio Deadlocks Starvation Race Conditions The Global Interpreter Lock The Factory Pattern The Builder Pattern Other Creational Patterns The Adapter Pattern The Decorator Pattern The Bridge Pattern The Facade Pattern Other Structural Patterns The Chain of Responsibility Pattern The Command Pattern The Observer Pattern 1. Appendix 2. Other Books You May Enjoy Index

Chapter 18


What is a communication channel? What is its connection to asynchronous programming?

Communication channels are used to denote both the physical wiring connection between different systems and the logical communication of data that facilitates computer networks. The latter is related to computing, and is more relevant to the idea of asynchronous programming. Asynchronous programming can provide functionalities that complement the process of facilitating communication channels efficiently.

What are the two main parts of the Open Systems Interconnection (OSI) model protocol layers? What purposes do each of them serve?

The media layers contain fairly low-level operations that interact with the underlying process of the communication channel, while the host layers deals with high-level data communication and manipulation.

What is the transport layer? Why is it crucial to communication channels?

The transport layer is often viewed as the conceptual transition between the media layers and the host layers, responsible for sending data along end-to-end connections between different systems.

How does asyncio facilitate the implementation of server-side communication channels?

Server-wise, the asyncio module combines the abstraction of transport with the implementation of an asynchronous program. Specifically, via its BaseTransport and BaseProtocol classes, asyncio provides different ways to customize the underlying architecture of a communication channel.

How doesasynciofacilitate the implementation of client-side communication channels?

Together with the aiohttp module and, specifically, aiohttp.ClientSession, asyncio also offers efficiency and flexibility regarding client-side communication processes, via asynchronously making requests and reading the returned responses.

What isaiofiles?

The aiofiles module, which can work in conjunction with asyncio and aiohttp, helps to facilitate asynchronous file reading/writing.

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 €18.99/month. Cancel anytime