Skip to Content
Hands-On Reactive Programming with Python
book

Hands-On Reactive Programming with Python

by Romain Picard
October 2018
Intermediate to advanced
420 pages
10h 26m
English
Packt Publishing
Content preview from Hands-On Reactive Programming with Python

Event loop

The event loop is the entity of AsyncIO and is in charge of scheduling all asynchronous actions that must executes concurrently. Fundamentally, it is just an infinite loop that waits for some events to happen and execute handlers associated with these events. In the case of AsyncIO, these handlers are coroutines.

An event loop is automatically created by asyncio when a process is started. A reference to this event loop can be retrieved with the get_event_loop function of the asyncio module. Event loops inherit from the BaseEventLoop abstract class.

This class contains several methods used to execute asynchronous code. One of them is the run_until_complete method. With these two methods, the wait coroutine of the previous part ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Programming with Design Patterns

Python Programming with Design Patterns

James W. Cooper

Publisher Resources

ISBN: 9781789138726Supplemental Content