Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What pattern of event driven procession does asyncio implement?

asyncio is an event driven core lib of python 3.4. I know twisted, a similar lib for asyncio, implements the Reactor pattern, but what kind of pattern does asyncio implement?

like image 640
Volodymyr Pavlenko Avatar asked Oct 19 '25 18:10

Volodymyr Pavlenko


2 Answers

Well, it uses reactor for posix. Windows implementation has proactor event loop too.

like image 95
Andrew Svetlov Avatar answered Oct 22 '25 10:10

Andrew Svetlov


As @AndrewSvetlov answered, Python already will select the most performant selector for you, depending on your operating system. Different selector event loops will be, ensuring to get the tightest loop, the most performant selector available on your operating system. So it implements both patterns.

like image 25
Sabuhi Shukurov Avatar answered Oct 22 '25 09:10

Sabuhi Shukurov