Comments (20)
Well, aiohttp is not fully wsgi compliant server and it won't. Wsgi spec doesn't say anything about asyncio coroutines. It is possible to make it compliant with readpayload=true parameter, but this is not for production, it reads payload into memory
from aiohttp.
I thought it is compatible with pep-3156? But it isn't.
It still says:
http client/server for asyncio (PEP-3156)
from aiohttp.
Ah, sorry. I thought about wsgi specs.
Intention for DataQueue is different from StreamReader. You can wrap payload into StreamReader very easily.
from aiohttp.
Regarding compatibility with pep-3156, it says nothing about http. That was one of the reasons why we moved http code from asyncio to separate project.
from aiohttp.
I could, but if I wrap them I would need to write my own program.
But what happens if I use gunicorn with django? It will fail horribly.
So only gunicorn could fix this up, or I would need to write my own 'gunicorn'. Best would be to just include that.
Also PEP-3156 says something about http.
A few functions and classes are provided to simplify the writing of basic stream-based clients and servers, such as FTP or HTTP. Thes are:
It is an Interface and Interfaces should be implemented in my eyes. But who cares.
from aiohttp.
gjango will fail horribly, because it is doesn't work with asyncio. Asyncio doesn't work like gevent, you can not just install aiohttp and make your application asynchronous. For non trivial application you have to rewrite it to use asyncio.
I don't understated "Interface" part of your comment. Could you elaborate.
from aiohttp.
Won't fix
from aiohttp.
@fafhrd91 not sure but why a buffered stream reader could not be used there? if buffer is empty or < n it could eventually claim for more data until eof.
from aiohttp.
DataQueue is not a bytes stream, it just holds arbitrary objects that parser emits. for example WebSocketParser emits aiohttp.websocket.Message named tuples. if application requires it is very easy to wrap DataQueue into StreamReader.
from aiohttp.
@fafhrd91 if it can be done easily, i think it would be good to have it imo :)
from aiohttp.
sure, if somebody explain how i can do byte streaming on arbitrary objects, like tuples :)
from aiohttp.
From my experience, you can't access to POST variables in a Flask application without a stacktrace with Gunicorn.
No idea to resolve that, but it looses the interest if we can't use main WSGI frameworks with that.
from aiohttp.
there is a way. we can change "readpayload" to True, then wsgi.input will work as expected. but this will mean that payload gets loaded into memory.
from aiohttp.
@benoitc how others workers in Gunicorn work to read payload? If they also load all in memory, "readpayload" to True is acceptable.
from aiohttp.
@GMLudo sync, thread and the default gevent/eventlet workers are streaming the data. they don't keep the full body in memory.
from aiohttp.
readpayload is to True in gaiohttp worker.
from aiohttp.
well I still think there should be a way to stream it. Should it be another ticket?
from aiohttp.
i've just created #87
from aiohttp.
Thanks!
On Sat, Jun 28, 2014 at 8:23 PM, Nikolay Kim [email protected]
wrote:
—
Reply to this email directly or view it on GitHub
#81 (comment).
from aiohttp.
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.
If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.
from aiohttp.
Related Issues (20)
- The `timeout` parameter of `aiohttp.ClientSession` does work for types other than `Union[ClientTimeout, _SENTINEL, None]` HOT 5
- Analyze additional places where there is timer handle churn HOT 7
- Risk of websocket ping tasks being garbage collected before they finish HOT 1
- Remove wait_for_disconnection
- Remove `allowed_protocol_schema_set` backwards compat in `BaseConnector` HOT 1
- Multipart reader fails on Transfer-Encoding: chunked HOT 9
- pytest example in testing.rst throws TypeError: 'async_generator' object is not callable HOT 2
- Response object reference to session returns None HOT 2
- ClientResponse.json() doesn't set status code HOT 3
- [typing] mypy errors when trying to extract headers when type is `LooseHeaders` HOT 1
- Support free-threaded Python 3.13 build HOT 2
- TypeError: _patch_task.<locals>.task_new_init() got an unexpected keyword argument 'eager_start' HOT 5
- Sending default 'Server' header when failing on wrong HTTP method HOT 6
- Websocket ping test has transient failures on loaded systems HOT 1
- Send 100-continue only when handler reads body
- typing error with `timeout` argument of `aiohttp.ClientSession` requests methods HOT 1
- Rename compress parameter HOT 6
- on_request_headers_sent params type was never imported into the top-level file. HOT 2
- AsyncResolver not passing on loop too aiodns.DNSResolver HOT 4
- test_web_sendfile_functional isn't testing sendfile
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiohttp.