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.

Show HN: HTTP/2 Python-Asyncio Web Microframework

173 pointsby pgjonesabout 7 years ago

10 comments

tomchristieabout 7 years ago
Neat, good to see more `asyncio` frameworks coming along.<p>Python&#x27;s going to have a bit of an awkward time with two completely different sets of ecosystem for threaded vs. asyncio approaches, but it&#x27;s necessary progress.<p>One thing I&#x27;d be really keen to see is asyncio frameworks starting to consider adopting ASGI as a common interface. Each of quart, sanic, aiohttp currently all have their own gunicorn worker classes, http parsing, and none share the same common interface for handling the request&#x2F;response interface between server and application.<p>It&#x27;s a really high barrier to new asyncio frameworks, and it means we&#x27;re not able to get shared middleware, such as WSGI&#x27;s whitenoise or Werkzeug debugger, or the increased robustness that shared server implementations would tend to result in.<p>Would be interested to know what OP&#x27;s position on this is?
评论 #16907319 未加载
评论 #16907495 未加载
评论 #16909203 未加载
mixmastamykabout 7 years ago
Isn&#x27;t this what sanic was supposed to be?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;channelcat&#x2F;sanic" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;channelcat&#x2F;sanic</a>
评论 #16905890 未加载
评论 #16905158 未加载
评论 #16905483 未加载
mcintyre1994about 7 years ago
This looks really nice, and Flask compatibility is great.<p>One question, in the asyncio docs (really nice BTW, I hadn&#x27;t tried that out yet and instantly grasped your example) you mention the common pitfall of `await awaitable.attribute` with missing brackets. In the Migration from Flask docs you give some examples where you need await like `await request.data` and `await request.get_json()` - do these need brackets in the same way or is `request` special? Same deal with `test_client` straight after that.<p>BTW, do all routes have to be async here - even your quickstart that just returns &#x27;hello&#x27;?<p>One other thing - since you require Python 3.6 anyway it&#x27;d probably make sense to use `pipenv` instead of `venv` as your recommended install, it&#x27;d probably make your docs simpler.
评论 #16904591 未加载
评论 #16905862 未加载
cmcgintyabout 7 years ago
The author was on a recent episode of Talk Python. <a href="https:&#x2F;&#x2F;talkpython.fm&#x2F;episodes&#x2F;show&#x2F;147&#x2F;quart-flask-but-3x-faster" rel="nofollow">https:&#x2F;&#x2F;talkpython.fm&#x2F;episodes&#x2F;show&#x2F;147&#x2F;quart-flask-but-3x-f...</a>
gamesbrainiacabout 7 years ago
I think this is all well and good, especially the compatibility with Flask. However, the biggest issue is the data access layer. Most flask apps will use an ORM like SQLAlchemy(SA) to create their data access layer.<p>SA unfortunately, does not have a asynchronous version (its quite complex as it is). Therefore, I think it would require quite a lot of work, in order to actually get a standard flask app to work with quart.<p>However, if you&#x27;ve built your data access layer directly on psycopg, then I think you&#x27;re good to go.
评论 #16906441 未加载
评论 #16906729 未加载
评论 #16906751 未加载
linsomniacabout 7 years ago
I started dabbling with Quart a few months ago and it looks really promising. But I haven&#x27;t developed any apps with it. My plan is to try building an app using it instead of Flask, I like Flask but I think this has some benefits in supporting the current future including websockets.
cup-of-teaabout 7 years ago
I&#x27;ve seen a few libraries like this now. Are they supposed to supersede the non asyncio versions? Is there any reason to still use flask? Will they be maintained like forks?
sandGorgonabout 7 years ago
could you add sqlalchemy integration docs as well ? because that is where I get stuck when thinking about async. How does psycogreen work with you asyncio apis ?
评论 #16905266 未加载
friend-monoidabout 7 years ago
Cool! Might try this for some smaller project. It&#x27;s a shame that asyncio is so slow though, this framework isn&#x27;t going to win any speed awards I guess.
评论 #16905962 未加载
dharnessabout 7 years ago
Why did you choose to host this on gitlab over github?
评论 #16905906 未加载
评论 #16904411 未加载
评论 #16904408 未加载