This workshop is intended for developers that want to learn asyncio and other new Python features related to asynchronous programming like await and async keywords. The course covers also testing and mocking coroutines.

At this workshop you will learn:

  • How to use key players from asyncio library?
  • When you should use asynchronous programming?
  • How to test and debug asynchronous programs?
  • How to use different event loop implementations?
  • How to isolate your tests with mock library?
  • How to avoid common pitfails related to asyncio?
  • And much, much more.

Course Syllabus

  1. Introduction to Coroutines​
  2. asyncio Library
  3. Use Cases for Asynchronous Programming
  4. Key Players
    1. Coroutines (both Functions and Objects)
    2. Futures
    3. Tasks
    4. Loops
  5. Syntax for Asynchronous Programming
    1. Asynchronous Functions (async def)
    2. Asynchronous Loops (async for)
    3. Asynchronous Context Managers (async with)
    4. Old Syntax for Coroutines (yield from)
    5. Integrating Code Written in Both Old and New Styles
  6. Overview of Event Loop Implementation
    1. Executing Tests
    2. Unittest
    3. Doctest
    4. Code Coverage
  7. Introduction to Testing with unittest Library
  8. Introduction to Test Isolation with mock Library
  9. Testing and Mocking Coroutines
  10. Debugging Asynchronous Code
  11. Common Pitfalls and Mistakes
  12. Synchronization between Coroutines
  13. Common Async Patterns