• Complain

Mohamed Mustapha Tahrioui - asyncio Recipes: A Problem-Solution Approach

Here you can read online Mohamed Mustapha Tahrioui - asyncio Recipes: A Problem-Solution Approach full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2019, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Mohamed Mustapha Tahrioui asyncio Recipes: A Problem-Solution Approach

asyncio Recipes: A Problem-Solution Approach: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "asyncio Recipes: A Problem-Solution Approach" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Get the most out of asyncio and find solutions to your most troubling Python programming problems. This book offers a pragmatic collection of recipes by going beyond online resources and docs to provide guidance on using this complex library. As such, youll see how to improve application performance and run computationally intensive programs faster.

asyncio Recipes starts with examples illustrating the primitives that come with the asyncio library, and explains how to determine if asyncio is the right choice for your application. It shows how to use asyncio to yield performance gains without multiple threads, and identifies common mistakes and how to prevent them. Later chapters cover error-handling, testing, and debugging. By the end of this book, youll understand how asyncio runs behind the scenes, and be confident enough to contribute to asyncio-first projects.

What You Will Learn
  • Discover quirky APIs such as the event loop policies
  • Write asyncio code with native coroutines
  • Use the ast module to find legacy asyncio code
  • Work with contextvars
  • See what a async context manager is and why a lot of asyncio APIs use them
Who This Book Is For

Experienced Python developers or hobbyists who want to understand asyncio and speed up their applications by adding concurrency to their toolkit.

Mohamed Mustapha Tahrioui: author's other books


Who wrote asyncio Recipes: A Problem-Solution Approach? Find out the surname, the name of the author of the book and a list of all author's works by series.

asyncio Recipes: A Problem-Solution Approach — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "asyncio Recipes: A Problem-Solution Approach" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Contents
Landmarks
Mohamed Mustapha Tahrioui asyncio Recipes A Problem-Solution Approach - photo 1
Mohamed Mustapha Tahrioui
asyncio Recipes A Problem-Solution Approach
Mohamed Mustapha Tahrioui Darmstadt Hessen Germany Any source code or other - photo 2
Mohamed Mustapha Tahrioui
Darmstadt, Hessen, Germany

Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the books product page, located at www.apress.com/978-1-4842-4400-5 . For more detailed information, please visit http://www.apress.com/source-code .

ISBN 978-1-4842-4400-5 e-ISBN 978-1-4842-4401-2
https://doi.org/10.1007/978-1-4842-4401-2
Mohamed Mustapha Tahrioui 2019
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.

For my beloved mother and father.

Introduction
Motivation

The Python programming language adopted a preemptive concurrency framework in the early 90s via the threading module, which strived to mimic the Java concurrency library, as per the respective commit message.

A simple but powerful mechanism governs concurrent execution of bytecode in most Python implementations. This mechanism is called the GIL (global interpreter lock). The interpreter consumes one bytecode instruction at a time.

This effectively means that only one thread can run at the same time (in one interpreter process). Despite this fact, the underlying native thread implementation might be able to run more than one thread at a time.

The threads are appointed fair amounts of CPU time. Without employing sophisticated introspection techniques, this boils down to simple/naive time-based scheduling algorithms.

Taking this approach in the past would often yield inferior solutions to an equivalent single threaded program, for Python implementation with a GIL like CPython.

Since removing the GIL is not an option, failed because they degraded the single threading performance significantly, the concurrency situation meant having only the threading module.

What Is Asyncio?

The cooperative concurrency framework asyncio was written to address the need for fast single-threaded programs that don't waste CPU time on I/O bound tasks.

Its primitives like coroutines and event loops allow developers to execute code only when its not waiting for I/O and to yield control back for other tasks.

Conclusion

Since its advent, asyncio has added countless APIs and keywords to the Python language ( async / await ). Its steep learning curve scares some developers from trying it. However, its a powerful technology thats even been used by big players like Instagram .

The motivation of this book is to help more developers adopt asyncio and experience the joy of using asyncio for fun and profit. With that said, enjoy this book while learning more about asyncio!

Acknowledgments

I would like to express my deep gratitude to

Mrs. Aditee Mirashi

Mr. Todd Green

Mr. Celestin Suresh John

Mr. James Markham

Mr. Matthew Moodle

Mr. Said El Mallouki

for their invaluable efforts during the execution of my book.

Furthermore, my special thanks are extended to my company axxessio and in special to

Mr. Goodarz Mahboobi

Mr. Keyvan Mahbobi

Table of Contents
About the Author and About the Technical Reviewer
About the Author
Mohamed Mustapha Tahrioui
has been a programmer for seven years and currently serves as a senior software - photo 3

has been a programmer for seven years and currently serves as a senior software engineer at axxessio. He is on the core team of the asyncio-heavy Telekom Smarthub project, where he offers his expertise for implementation, backward compatible architecture and implementation. He also offers full stack development via his IT consultancy Pi Intelligence, using Python, Java, JavaScript, Docker, PostgreSQL, MongoDB, and more.

About the Technical Reviewer
Said El Mallouki
is a textbook computer geek with decades of experience designing and developing - photo 4

is a textbook computer geek with decades of experience designing and developing enterprise IT systems. His early encounters with the internals of computers took place at IBMs production facility in Germany more than two decades ago. In his current occupation as a technology lead, he is developing a toolchain for a natural language-understanding system at Deutsche Telekom. The intricacies of complex distributed systems were always on the top of his interest list. With three degrees in IT, business, and marketing, he combines a solid theoretical foundation with plenty of real-life experience. Living in Germany by the Rhine with his wife Andrea and their 18-month son Felix, his current favorite leisure activity is to be a devoted father.

Footnotes

https://docs.python.org/3/faq/library.html#can-t-we-get-rid-of-the-global-interpreter-lock

https://code.google.com/archive/p/python-safethread

https://www.youtube.com/watch?v=ACgMTqX5Ee4

Mohamed Mustapha Tahrioui 2019
Mohamed Mustapha Tahrioui asyncio Recipes https://doi.org/10.1007/978-1-4842-4401-2_1
1. Preparing for the Recipes
Mohamed Mustapha Tahrioui
(1)
Darmstadt, Hessen, Germany
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «asyncio Recipes: A Problem-Solution Approach»

Look at similar books to asyncio Recipes: A Problem-Solution Approach. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «asyncio Recipes: A Problem-Solution Approach»

Discussion, reviews of the book asyncio Recipes: A Problem-Solution Approach and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.