<br><br><div class="gmail_quote">On Mon, May 12, 2008 at 3:25 AM, Christopher Stawarz <<a href="mailto:cstawarz@csail.mit.edu">cstawarz@csail.mit.edu</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On May 11, 2008, at 7:05 PM, Phillip J. Eby wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
For this to work, you're going to need this to take the wsgi.input object as a parameter. If you don't, then this will bypass middleware that replaces wsgi.input.<br>
<br>
That is, you will need a way for this spec to support middleware that's replacing wsgi.input, without the middleware knowing that this specification exists. In the worst case, it should detect the replaced input and give an error or some response that lets the application know it won't really be able to use the async feature.<br>
</blockquote>
<br></div>
I hadn't considered middleware that replaces wsgi.input. Is there an example component you can point me to, just so I have something concrete to look at?<br>
<br>
Given that the semantics of wsgi.input are, in general, incompatible with non-blocking execution, I'm inclined to think that such middleware would either need to be rewritten to use x-wsgiorg.async.input, or just couldn't be used with asynchronous servers. But I'll think about it some more -- maybe there's a way to make this work.<div class="Ih2E3d">
</div></blockquote><div><br> </div></div>Making input filters work could be achieved using greenlets - but then again - if one would use greenlets he could use them to simulate a seemingly blocking api for the input so this is pretty much pointless.<br>
<br>But I agree, detecting this is good and errors should be thrown in this case.<br>In cogen i'm setting wsgi.input to None - so any use of it would end in a error - though it's not very elegant.<br><br clear="all">
<br>-- <br><a href="http://ionelmc.wordpress.com">http://ionelmc.wordpress.com</a><br>