TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Python: Generators, Coroutines, Native Coroutines and Async/Await

147 pointsby snwover 9 years ago

4 comments

mariocesarover 9 years ago
If you don&#x27;t have the latest asyncio version, change `ensure_future` to `async`.<p>&gt; asyncio.async(display_date(1, loop))<p>See this <a href="https:&#x2F;&#x2F;github.com&#x2F;python&#x2F;asyncio&#x2F;pull&#x2F;242" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;python&#x2F;asyncio&#x2F;pull&#x2F;242</a><p>The author is using the latest release of asyncio, will be good to mention that.
harlowjaover 9 years ago
Anyone know when most of the python stdlib (the batteries included part) will start itself using async&#x2F;await (for any&#x2F;all things that could block)?? I suppose it will never change due to backwards compat. (which feels odd...)?
评论 #10683533 未加载
评论 #10683152 未加载
评论 #10683847 未加载
评论 #10683735 未加载
bawanaover 9 years ago
Async is not new. life has been doing it for millennia. Your heart does not stop beating while you breathe, yet both systems are interrelated. The body accomplishes this through the use of &#x27;buffers&#x27;. Pause one system long enough and the other will fail. So we have evolved a &#x27;scheduler&#x27; - the hindbrain that starts to scream louder and louder when the event queue of one system becomes too long. It might be instructive to model this in silicon. Have one cpu core be the scheduler. Have every set of interrelated processes (that are Async) register their variables with the scheduler. The scheduler then keeps track of these sets. When a variable in a set changes, pause that process for two cycles.
macavity23over 9 years ago
A good article, but it should mention async network programming (probably with <a href="http:&#x2F;&#x2F;www.tornadoweb.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.tornadoweb.org&#x2F;</a>) which is the major driving use case behind the adoption of async programming patterns.