python - How does asyncio's event loop know when an awaitable resource is ready? -


i'm learning python asyncio asynchronous programing. know event loop watch on future objects until ready , resumes appropriate coroutines continue execution in point await keyword occurred.

this understandable when use asyncio.sleep because sleeping function knows how many time take , know event loop what happens relies on networking ( example) waiting time unknown?.

how event loop know when resource ready or how many time take gather data source?

how event loop know when resource ready or how many time take gather data source?

the default event loop (based on selectoreventloop) uses selector module keep track of resources monitor , notified when new data ready. baseselector.select where magic happens.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -