Sujet : Re: Await expressions
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 02. Feb 2024, 10:12:06
Autres entêtes
Organisation : Stefan Ram
Message-ID : <IO-20240202101058@ram.dialup.fu-berlin.de>
References : 1 2 3 4
ram@zedat.fu-berlin.de (Stefan Ram) writes:
So, this is how the control is transferred to the event
loop after an "await sleep"! Initially, the control goes
to "sleep", but this transfers the control to the event loop
(until "sleep" stops waiting for its future in "await future").
And, to answer one final question, let me quote the Web again.
The author name is not indicated clearly, but probably it's "Bharel":
|The final burning question we must answer is - how is the IO
|implemented?
...
|The IO part of the event loop is built upon a single crucial
|function called "select".
...
|When all available tasks are waiting for futures, the event
|loop calls select and waits. When the one of the sockets has
|incoming data, or its send buffer drained up, asyncio checks
|for the future object tied to that socket, and sets it to
|done.
...
probably Bharel.