We can define event loops as abstractions that ease up by using polling functions to monitor events. Internally, event loops make use of poller objects, taking away the responsibility of the programmer to control the tasks of addition, removal, and control of events. Some examples of applications that implement event loops in Python are as follows:
- Tornado web server (http://www.tornadoweb.org/en/stable): Tornado uses epoll as the polling function if the environment is Linux and has kqueue support in the case of BSD or Mac OS X
- Twisted (https://twistedmatrix.com): This is a popular framework that offers an implementation of the event loop and is used by the Scrapy framework
- Gevent (http://www.gevent.org): This provides an event loop based on libev
- Eventlet (https://pypi.python.org/pypi/eventlet): This implements an event loop based on libevent
In this section, you have learned about the asyncio and aiohttp packages, which simplify the process of writing servers when using an event-driven approach, and we explained some uses cases related to file downloading in an asynchronous way. In the next section, we are going to introduce the Tornado framework for building asynchronous network applications.