Skip to Content
Software Architecture with Python
book

Software Architecture with Python

by Anand Balachandran Pillai
April 2017
Intermediate to advanced
556 pages
11h 5m
English
Packt Publishing
Content preview from Software Architecture with Python

The asyncio module in Python

The asyncio module in Python provides support for writing concurrent, single-threaded programs using co-routines. It is available only in Python 3.

A co-routine using the asyncio module is one that uses either of the following approaches:

  • Using the async def statement for defining functions
  • Being decorated using the @asyncio.coroutine expression

Generator-based co-routines use the second technique, and they yield from expressions.

Co-routines created using the first technique typically use the await <future> expression to wait for the future to be completed.

Co-routines are scheduled for execution using an event loop, which connects the objects and schedules them as tasks. Different types of event loop are provided for different ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Architecture Patterns with Python

Architecture Patterns with Python

Harry Percival, Bob Gregory

Publisher Resources

ISBN: 9781786468529Supplemental Content