KeepSafe/aiohttp — pull request #40 by hanula (2014-04-24 21:40:50+00:00)
Title: New AsyncNoStreamGunicornWorker and a fix for event loop creation in new workers

Hi,

``AsyncGunicornWorker`` seems to not work very well when used with frameworks like pyramid/web and fails as webob tries to read request body with chunks and wsgi.input with this worker requires to use ``yield from environ['wsgi.input'].read()``. I've added ``AsyncNoStreamGunicornWorker`` which reads data and provides wsgi.input as ``BytesIO`` object.

Additionally, [following code](https://gist.github.com/hanula/11270058) doesn't work when the worker updates asyncio's default event loop with new one. Now when new event loop is only used for worker's own runner, all works fine.

After checking plenty of places and ways to change own code, seems like patching ``aiohttp`` is the only way. ``AsyncNoStreamGunicornWorker`` might need a better name maybe?

Cheers!