Asynchronous_Programming_Flashcards
Asynchronous_Programming_Flashcards
Flashcard 1
**Question:** What is the purpose of the concurrent.futures module?
Flashcard 2
**Question:** What is the asynchronous approach to task execution?
**Answer:** The asynchronous approach executes various tasks that intersect along the
timeline under a single flow of control. Tasks are suspended and resumed over time,
alternating with the execution of other tasks, without running on multiple threads.
Flashcard 3
**Question:** What are the main components of asyncio?
**Answer:** The main components of asyncio include Event Loop (manages task
distribution), Coroutines (suspendable computations), Futures (represent unfinished
tasks), and Tasks (manage coroutines).
Flashcard 4
**Question:** What is the sequence of task execution in an event loop?
**Answer:** In an event loop, tasks are registered, queued, and executed one at a time by
invoking their handlers, ensuring control passes to the next task only when the current
handler finishes.
Flashcard 5
**Question:** How does the yield from syntax work in coroutines?
**Answer:** The yield from syntax allows a coroutine to wait for another coroutine or
future to complete. The result of the awaited task is then propagated back to the waiting
coroutine.
Flashcard 6
**Question:** What is an argument in the context of a coroutine?