cogen.web.async
cogen.web.wsgi server is asynchronous by default.
If you need to run a app that uses wsgi.input synchronously you need to wrapp
it in SynchronousInputMiddleware.
-
class cogen.web.async.LazyStartResponseMiddleware(app, global_conf={})
This is a evil piece of middleware that proxyes the start_response
call and delays it till the appiter yields a non-empty string.
Also, this returns a fake write callable that buffers the strings passed
though it. Use at your own peril :)
-
start_response(status, headers, exc=None)
-
class cogen.web.async.SynchronousInputMiddleware(app, global_conf={}, buffer_length=1024)
- Middleware for providing a regular synchronous wsgi.input to the app.
Note that it reads the whole input in memory so you sould rather use the
async input (environ[‘cogen.input’]) for large requests.