June 2017
Beginner to intermediate
274 pages
6h 49m
English
For the asynchronous protocol, the __enter__ and __exit__ methods are replaced by __aenter__ and __aexit__ coroutine methods and the context manager is invoked by an async with statement, as shown here:

This small change buys us the ability to have the __enter__ and __exit__ methods invoke other coroutines, wait for data to come in from the network, and behave nicely in an asyncio-based program.
Read now
Unlock full access