Context managers provide a convenient API to govern a runtime context. They expose the ability to hook into entering the context manager scope and exit it. Given that asyncio extends the language with the possibility of execution suspension, it becomes evident that a synchronous context manager cannot interface with the event loop in a seamless fashion.
An asynchronous context manager is a context manager that can use the await keyword to suspend execution in its enter and exit methods. This way, it can yield control back to the event loop and interact ...