
Explore asynchronous programming in Python with the asyncio module, its history since 2013, and the async/await enhancements in Python 3.5. Learn how the event loop enables writing asynchronous code.
Compare threading and asyncio, showing that threading runs on multiple cpu threads while asyncio uses one thread with async and await to control execution order and race conditions.
During this series I'll we using Python v3.8.10. Make sure that you are at least on Python 3.7.
Learn asynchronous programming in Python by using async and await, creating and running coroutines, and applying async for loops, async context managers, asynchronous generators, and list comprehension.
Learn how to define and run asynchronous functions with async and await in Python, using asyncio.run and asyncio.sleep to yield control and handle coroutine results.
Explore how the @asynccontextmanager decorator enables asynchronous context managers, demonstrating an example that yields a mock database connection within an async with statement, including setup, yield, and teardown steps.
Learn to implement asynchronous context manager classes in Python with a connection class, using the asynchronous enter and exit methods to simulate setup and teardown with sleep.
Learn how asynchronous generators in Python use yield and await to yield simulated URL responses, iterating with an async for loop to mimic downloading multiple URLs.
Explore the basics of asynchronous Python with asyncio, review earlier section objects, and learn how to run routines, inject exceptions, and pull objects with a custom method.
Explore coroutine objects in asyncio, how they resume suspended functions, and their use in await expressions, then distinguish async from regular functions with inspect.iscoroutinefunction and inspect checks.
The lecture explains that the await expression works with awaitables, including coroutines, tasks, and futures, and shows how to define the special await methods to make your own objects awaitable.
Explore the low level API of asyncio by interacting with the event loop and examining tasks and futures. Build a foundational understanding of asynchronous Python and async IO.
Explore how task objects in asyncio interact with the event loop, including naming tasks, inspecting their properties, and using a done callback to run a function when a task completes.
Learn that the asyncio event loop is a thread-local object; printing asyncio without a running loop raises a runtime error, while an async function exposes a loop per thread.
Explore the future object in asyncio, its relationship to the task object, and how methods available on tasks also apply to futures, including checking if an object is a future.
Celebrate completing the asynchronous Python with Asyncio course and feel free to reach out as you explore more topics and future courses.
The native asyncio library in Python allows you to write concurrent code using the `async` and `await` keywords. The official documentation on asyncio might be somewhat daunting, therefore I hope to make writing asynchronous code more accessible to the less experienced Python developer.
Asyncio is used in multiple Python asynchronous frameworks. Besides that it is practical in your own applications where you deal with network connections or concurrent HTTP requests.
The asyncio module was introduced in Python 3.4 and therefore not new per se. However, with Python version 3.7 the API of the asyncio module received quite some changes. These changes allow developers to interact more easily with the event loop.
During this course I will teach you:
How to use the new async and await keywords
All about the asyncio module
Run coroutines
About the event loop in Python
The differences between asyncio and threading
About Me
My name is Koen, it is nice to meet you. Starting out at the age of 15 with iOS development I never lost my interest in Software Development. Currently I mainly keep myself occupied with web development. I am invested in multiple backend technologies and frameworks, such as Ruby on Rails, Django and Laravel. On the frontend side of projects I follow the development of React, Alpine.js and Vue.js closely.