Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-09 Thread Manlio Perillo
Phillip J. Eby ha scritto: > [...] > If we were just now defining WSGI 1.0, I would let it be any method and > explicitly document that servers doing cache validation or processing a > HEAD method can skip iteration of the body, so that you can get better > performance. > > However, if we put t

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-09 Thread Thomas Broyer
2007/10/9, Graham Dumpleton <[EMAIL PROTECTED]>: > On 09/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > > > Since GET is supposed to be side effect-free, skipping the > > calculation of the response body (by not iterating over it) is less > > likely to cause a problem than with another requ

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-08 Thread Graham Dumpleton
On 09/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 08:23 AM 10/9/2007 +1000, Graham Dumpleton wrote: > >On 09/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > > At 06:25 PM 10/8/2007 +0200, Manlio Perillo wrote: > > > >Phillip J. Eby ha scritto: > > > > > [...] > > > > > > > > > >

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-08 Thread Phillip J. Eby
At 08:23 AM 10/9/2007 +1000, Graham Dumpleton wrote: >On 09/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > At 06:25 PM 10/8/2007 +0200, Manlio Perillo wrote: > > >Phillip J. Eby ha scritto: > > > > [...] > > > > > > > > I don't think there's any point to having a WSGI extension for If-* > >

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-08 Thread Graham Dumpleton
On 09/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 06:25 PM 10/8/2007 +0200, Manlio Perillo wrote: > >Phillip J. Eby ha scritto: > > > [...] > > > > > > I don't think there's any point to having a WSGI extension for If-* > > > header support. > > > >I have just found that the WSGI spec s

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-08 Thread Phillip J. Eby
At 06:25 PM 10/8/2007 +0200, Manlio Perillo wrote: >Phillip J. Eby ha scritto: > > [...] > > > > I don't think there's any point to having a WSGI extension for If-* > > header support. > >I have just found that the WSGI spec says: >"""...it should be clear that a server may handle cache validation

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-08 Thread Manlio Perillo
Thomas Broyer ha scritto: > 2007/10/8, Manlio Perillo: >> However there are two problems here: >> 1) It is not clear if WSGI explicitly allows an implementation to skip >>the iteration over the app_iter object, for optimization purpose >> 2) For a WSGI implementation embedded in an existing web

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-08 Thread Thomas Broyer
2007/10/8, Manlio Perillo: > However there are two problems here: > 1) It is not clear if WSGI explicitly allows an implementation to skip >the iteration over the app_iter object, for optimization purpose > 2) For a WSGI implementation embedded in an existing webserver, the >most convenient

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-08 Thread Thomas Broyer
2007/10/8, Manlio Perillo: > Phillip J. Eby ha scritto: > > [...] > > > > I don't think there's any point to having a WSGI extension for If-* > > header support. > > I have just found that the WSGI spec says: > """...it should be clear that a server may handle cache validation via > the If-None-Mat

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-08 Thread Manlio Perillo
Phillip J. Eby ha scritto: > [...] > > I don't think there's any point to having a WSGI extension for If-* > header support. I have just found that the WSGI spec says: """...it should be clear that a server may handle cache validation via the If-None-Match and If-Modified-Since request header

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-05 Thread Phillip J. Eby
At 12:36 PM 10/5/2007 +0200, Manlio Perillo wrote: >Phillip J. Eby ha scritto: > > [...] > > Yep, but another argument in favor of getting rid of as much > > statefulness from the protocol as we can. Making the status and headers > > part of the return value entirely eliminates the question of whe

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-05 Thread Manlio Perillo
Phillip J. Eby ha scritto: > [...] > Yep, but another argument in favor of getting rid of as much > statefulness from the protocol as we can. Making the status and headers > part of the return value entirely eliminates the question of when > they're going to get written, and whether they can be

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Graham Dumpleton
On 05/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 09:03 AM 10/5/2007 +1000, Graham Dumpleton wrote: > >Too early for me to be thinking straight and work it out for myself, > >but does this all help in making it simpler or more obvious what the > >cleanup requirements are for a generator

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Phillip J. Eby
At 09:03 AM 10/5/2007 +1000, Graham Dumpleton wrote: >Too early for me to be thinking straight and work it out for myself, >but does this all help in making it simpler or more obvious what the >cleanup requirements are for a generator. Ie., correct use of >try/except/finally around yield and purpos

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Graham Dumpleton
On 04/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > >But once you have called start_response() you cant call it a second > >time to change the values > > You can, as long as you pass in the exception info -- because an > exception is the only legitimate reason to change the values. Okay, fo

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Manlio Perillo
Phillip J. Eby ha scritto: > At 06:07 PM 10/4/2007 +0200, Manlio Perillo wrote: >> For nginx mod_wsgi I'm planning to add support to blocking >> application,executing them in a thread (*but* there will be only one >> thread per process, and the entire result will be buffered). >> >> Threaded execut

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Chris McDonough
On Oct 4, 2007, at 11:55 AM, Phillip J. Eby wrote: > At 05:00 PM 10/4/2007 +0200, Manlio Perillo wrote: >> Your are making a critical decision here. >> You are lowering the level of WSGI to match the level of average WSGI >> middlewares programmers. > > No, we're just getting rid of legacy cruft

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Phillip J. Eby
At 06:07 PM 10/4/2007 +0200, Manlio Perillo wrote: >For nginx mod_wsgi I'm planning to add support to blocking >application,executing them in a thread (*but* there will be only one >thread per process, and the entire result will be buffered). > >Threaded execution will be disabled by default, and c

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Manlio Perillo
Phillip J. Eby ha scritto: > [...] >> I have read a lot of archived messages, and all I have seen are >> *discussions* about asynchronous extensions, but no working >> implementations. > > Because nobody came up with anything particularly useful. While it's > possible to have generic extensions

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Phillip J. Eby
At 05:00 PM 10/4/2007 +0200, Manlio Perillo wrote: >Your are making a critical decision here. >You are lowering the level of WSGI to match the level of average WSGI >middlewares programmers. No, we're just getting rid of legacy cruft that's hard to support correctly. There's a big difference.

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Manlio Perillo
Phillip J. Eby ha scritto: > At 04:10 PM 10/4/2007 +0200, Manlio Perillo wrote: >> Graham Dumpleton ha scritto: >> > [...] >> >> The idea was to allow an application to change its mind about the >> >> headers until it had committed to writing data. That is, to allow >> >> the application to do err

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Manlio Perillo
Phillip J. Eby ha scritto: > [...] > >> However I have to admit that developing a full asynchronous application >> is not easy, notably when we have to interact with a database and a >> transaction. > > Right - in practice, there is not enough of a common async API for > Python to make it practic

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Phillip J. Eby
At 04:10 PM 10/4/2007 +0200, Manlio Perillo wrote: >Graham Dumpleton ha scritto: > > [...] > >> The idea was to allow an application to change its mind about the > >> headers until it had committed to writing data. That is, to allow > >> the application to do error handling for as long as possible

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Phillip J. Eby
At 03:53 PM 10/4/2007 +0200, Manlio Perillo wrote: >Phillip J. Eby ha scritto: > > At 10:57 AM 10/4/2007 +0200, Manlio Perillo wrote: > >> Phillip J. Eby ha scritto: > >> > [...] > >> >> There is a problem here: a WSGI gateway is not allowed to send headers > >> >> until the app_iter yields a non e

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Manlio Perillo
Graham Dumpleton ha scritto: > [...] >> The idea was to allow an application to change its mind about the >> headers until it had committed to writing data. That is, to allow >> the application to do error handling for as long as possible before >> the server has to do it. > > But once you have c

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Manlio Perillo
Phillip J. Eby ha scritto: > At 10:57 AM 10/4/2007 +0200, Manlio Perillo wrote: >> Phillip J. Eby ha scritto: >> > [...] >> >> There is a problem here: a WSGI gateway is not allowed to send headers >> >> until the app_iter yields a non empty string or the iterator is >> exausted. >> > >> > Argh.

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Phillip J. Eby
At 10:20 PM 10/4/2007 +1000, Graham Dumpleton wrote: >On 04/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > At 12:30 PM 10/4/2007 +1000, Graham Dumpleton wrote: > > >On 04/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > > > At 09:52 PM 10/3/2007 +0200, Manlio Perillo wrote: > > > > >T

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Graham Dumpleton
On 04/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 12:30 PM 10/4/2007 +1000, Graham Dumpleton wrote: > >On 04/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > > At 09:52 PM 10/3/2007 +0200, Manlio Perillo wrote: > > > >There is a problem here: a WSGI gateway is not allowed to send

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Phillip J. Eby
At 10:57 AM 10/4/2007 +0200, Manlio Perillo wrote: >Phillip J. Eby ha scritto: > > [...] > >> There is a problem here: a WSGI gateway is not allowed to send headers > >> until the app_iter yields a non empty string or the iterator is exausted. > > > > Argh. You're right. I forgot about that bit.

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Phillip J. Eby
At 12:30 PM 10/4/2007 +1000, Graham Dumpleton wrote: >On 04/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > At 09:52 PM 10/3/2007 +0200, Manlio Perillo wrote: > > >There is a problem here: a WSGI gateway is not allowed to send headers > > >until the app_iter yields a non empty string or the

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-04 Thread Manlio Perillo
Phillip J. Eby ha scritto: > [...] >> There is a problem here: a WSGI gateway is not allowed to send headers >> until the app_iter yields a non empty string or the iterator is exausted. > > Argh. You're right. I forgot about that bit. It has been a few too > many years since I worked on the sp

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Graham Dumpleton
On 04/10/2007, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 09:52 PM 10/3/2007 +0200, Manlio Perillo wrote: > >Phillip J. Eby ha scritto: > > > [...] > > > > > > Now that I understand what this is for, I can explain why a WSGI > > > extension is not necessary to provide this feature. In a compli

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Phillip J. Eby
At 09:52 PM 10/3/2007 +0200, Manlio Perillo wrote: >Phillip J. Eby ha scritto: > > [...] > > > > Now that I understand what this is for, I can explain why a WSGI > > extension is not necessary to provide this feature. In a compliant WSGI > > gateway, yielding an empty string from 'a-generator' is

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Manlio Perillo
Phillip J. Eby ha scritto: > At 08:24 PM 10/3/2007 +0200, Manlio Perillo wrote: >> WSGI already >> states that the WSGI gateway should not buffer the data). > > It does not state that at all. It states that a gateway *must not delay > the transmission of any block*. That requirement is not a "s

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Manlio Perillo
Phillip J. Eby ha scritto: > [...] > > Now that I understand what this is for, I can explain why a WSGI > extension is not necessary to provide this feature. In a compliant WSGI > gateway, yielding an empty string from 'a-generator' is sufficient to > "flush" the WSGI pipeline. > But the WSG

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Phillip J. Eby
At 04:57 PM 10/3/2007 +0200, Manlio Perillo wrote: >A possibile solution can be to add an extension `x-wsgiorg.flush`, a >callable object that notify the WSGI gateway that it can flush the >headers (if they are not yet be sent) or the output buffer (Nginx has >this feature, however I have yet not u

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Phillip J. Eby
At 08:24 PM 10/3/2007 +0200, Manlio Perillo wrote: >WSGI already >states that the WSGI gateway should not buffer the data). It does not state that at all. It states that a gateway *must not delay the transmission of any block*. That requirement is not a "should" but a "must", and it does not d

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Manlio Perillo
Manlio Perillo ha scritto: > [...] > Note that in Nginx, unlike Apache, an output buffer can process a > partial buffer, Sorry, this is not correct. The only difference from Apache, here, is that the data is written asynchronously. Manlio Perillo ___

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Manlio Perillo
Phillip J. Eby ha scritto: > At 07:03 PM 10/3/2007 +0200, Manlio Perillo wrote: >> Phillip J. Eby ha scritto: >> > Thinking about this made me realize that WSGI 2.0 isn't going to be >> able >> > to validate *anything* about a response by raising an error in the >> > application, because everythin

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Phillip J. Eby
At 07:03 PM 10/3/2007 +0200, Manlio Perillo wrote: >Phillip J. Eby ha scritto: > > Thinking about this made me realize that WSGI 2.0 isn't going to be able > > to validate *anything* about a response by raising an error in the > > application, because everything is done after the code returns. > >

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Manlio Perillo
Phillip J. Eby ha scritto: > Thinking about this made me realize that WSGI 2.0 isn't going to be able > to validate *anything* about a response by raising an error in the > application, because everything is done after the code returns. > In this case, if the cache validation fails, we just hav

Re: [Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Phillip J. Eby
Thinking about this made me realize that WSGI 2.0 isn't going to be able to validate *anything* about a response by raising an error in the application, because everything is done after the code returns. That suggests to me that these sorts of errors should be handled by changing the response s

[Web-SIG] [extension] x-wsgiorg.flush

2007-10-03 Thread Manlio Perillo
Hi. Nginx, in one of the headers filters, can do ETag and Last-Modified validation. I want to be able to use this feature, so I don't have to use thirdy party solutions. However with the current WSGI implementation this is not possible. A possibile solution can be to add an extension `x-wsgio