Re: [Web-SIG] WSGI and asyncio (tulip)?

2014-10-14 Thread Antoine Pitrou
On Wed, 15 Oct 2014 11:28:42 +1300 Robert Collins wrote: > On 15 October 2014 11:10, Antoine Pitrou wrote: > > > Each time a connection is accepted, protocol_factory is called without > > arguments(**) to create a Protocol, a bidirectional stream Transport is > >

Re: [Web-SIG] WSGI and asyncio (tulip)?

2014-10-14 Thread Antoine Pitrou
On Wed, 15 Oct 2014 10:48:37 +1300 Robert Collins wrote: > On 15 October 2014 10:04, Antoine Pitrou wrote: > ... > > (that's for the HTTP part; a websockets layer would probably implement > > a separate transport and accept a separate protocol factory; actually, > >

Re: [Web-SIG] WSGI and asyncio (tulip)?

2014-10-14 Thread Antoine Pitrou
On Wed, 15 Oct 2014 09:22:28 +1300 Robert Collins wrote: > > > > You may have misunderstood me. I am talking about the Transport and > > Protocol abstractions defined in PEP 3156. > > Lets assume I did. Given say nginx + uwsgi + asyncio, you're proposing > that there be a uwsgi-asyncio module tha

Re: [Web-SIG] WSGI and asyncio (tulip)?

2014-10-14 Thread Antoine Pitrou
On Wed, 15 Oct 2014 08:40:05 +1300 Robert Collins wrote: > On 15 October 2014 07:30, Antoine Pitrou wrote: > > On Tue, 14 Oct 2014 09:47:35 -0700 > > Guido van Rossum wrote: > >> > >> I'm wondering if a small extension to the WSGI protocol might be suffic

Re: [Web-SIG] WSGI and asyncio (tulip)?

2014-10-14 Thread Antoine Pitrou
On Tue, 14 Oct 2014 09:47:35 -0700 Guido van Rossum wrote: > > I'm wondering if a small extension to the WSGI protocol might be sufficient > to support this: the special environ variable "wsgi.async_input" could > optionally be tied to a standard asyncio stream reader ( > https://docs.python.org/

Re: [Web-SIG] WSGI: allowing short reads

2014-09-27 Thread Antoine Pitrou
On Sun, 28 Sep 2014 10:43:33 +1300 Robert Collins wrote: > > > > It was in the context of improving streamed unpickling, which is > > a problem a bit similar - but less horrible - to JSON unserializing; > > since then, the problem was solved in a different way by adding a > > framing layer to pick

Re: [Web-SIG] WSGI: allowing short reads

2014-09-27 Thread Antoine Pitrou
Hi, Robert Collins writes: > > https://github.com/python-web-sig/wsgi-ng/issues/5 > > tl;dr - we don't specify whether read(size) has to return size bytes > or just not more than size, today. the IO library is clear that > read(n) returns up to n, and also offers read1 that guarantees only > o

Re: [Web-SIG] A 'shutdown' function in WSGI

2012-02-21 Thread Antoine Pitrou
Tarek Ziadé writes: > > here's a very simple demo: http://tarek.pastebin.mozilla.org/1489505 > > There are two typos but the effect remains the same since you are locked > before you reach those lines: > - atexit call worker.stop() instead  > of worker.join() > - in worker.stop(), it calls worke

Re: [Web-SIG] A 'shutdown' function in WSGI

2012-02-21 Thread Antoine Pitrou
Tarek Ziadé writes: > > > On Tue, Feb 21, 2012 at 10:24 AM, Graham Dumpleton wrote: > ... > > But I don't think you can guarantee that everything is still up in memory by > > the time atexit gets called, > > so you can't really call cleanup code there. > The only thing which is done prior to at

Re: [Web-SIG] PEP 444 / WSGI 2 Async

2011-01-07 Thread Antoine Pitrou
Alice Bevan–McGregor writes: > > On 2011-01-07 13:21:36 -0800, Antoine Pitrou said: > > Ok, so, WSGI doesn't "already involve generators". QED. > > This can go around in circles; by allowing all forms of iterable, it > involves generators. Geneators are a

Re: [Web-SIG] PEP 444 / WSGI 2 Async

2011-01-07 Thread Antoine Pitrou
Alice Bevan–McGregor writes: > > On 2011-01-07 09:04:07 -0800, Antoine Pitrou said: > > Alice Bevan–McGregor writes: > >>> I don't understand why you want a "yield" at this level. IMHO, WSGI > >>> needn't involve generators. A higher-le

Re: [Web-SIG] PEP 444 / WSGI 2 Async

2011-01-07 Thread Antoine Pitrou
Alice Bevan–McGregor writes: > > > I don't understand why you want a "yield" at this level. IMHO, WSGI > > needn't involve generators. A higher-level wrapper (framework, > > middleware, whatever) can wrap fd-waiting in fancy generator stuff if > > so desired. Or, in some other environments, de

Re: [Web-SIG] Declaring PEP 3333 accepted (CGI example)

2011-01-07 Thread Antoine Pitrou
Hello, P.J. Eby writes: > > > if headers_sent: > > # Re-raise original exception if headers sent > >-raise exc_info[0], exc_info[1], exc_info[2] > >+raise > >exc_info[0](exc_info[1]).with_traceback(exc_info[2]) > >

Re: [Web-SIG] PEP 444 / WSGI 2 Async

2011-01-06 Thread Antoine Pitrou
Alice Bevan–McGregor writes: > > Er, for the record, in Python 3 non-blocking file objects return None when > > read() would block. > > -1 > > I'm aware, however that's not practically useful. How would you detect > from within the WSGI 2 application that the file object has become > readable

Re: [Web-SIG] PEP 444 / WSGI 2 Async

2011-01-06 Thread Antoine Pitrou
Alice Bevan–McGregor writes: > > agronholm: what new features does pep 444 propose to add to pep ? \ > async, filters, no buffering? > > GothAlice: Async, filters, no server-level buffering, native string > usage, the definition of "byte string" as "the format returned by > socket read" (

Re: [Web-SIG] CGI in PEP 444

2011-01-04 Thread Antoine Pitrou
Eric Larson writes: > It is important to recognize that "production" doesn't necessarily > have to be some ultra powerful server somewhere that is central to > some organization. A simple server running Apache with CGI is just as > valid a production environment as an EC2 cluster. This is especial

Re: [Web-SIG] CGI in PEP 444

2011-01-04 Thread Antoine Pitrou
P.J. Eby writes: > > At 12:43 PM 1/4/2011 +, Antoine Pitrou wrote: > >Alice Bevan­McGregor writes: > > [1] > >http:://bit.ly/e7rtI6 So, while we are at it, could we get rid of > >the "CGI server example" in this new SWGI spec? This is 2011, and

[Web-SIG] CGI in PEP 444

2011-01-04 Thread Antoine Pitrou
Alice Bevan–McGregor writes: > > [1] http://bit.ly/e7rtI6 So, while we are at it, could we get rid of the "CGI server example" in this new SWGI spec? This is 2011, and we should promote modern idioms, not encourage people to do 1995 Web programming. 10 years ago, CGI was already frown upon. (and

[Web-SIG] decoding environ

2010-07-17 Thread Antoine Pitrou
Ian Bicking writes: > > So... there's been some discussion of WSGI on Python 3 lately. > I'm not feeling as pessimistic as some people, I feel like we were close > but just didn't *quite* get there. > Here's my thoughts: > * Everyone agrees keys in the environ should be native strings I don't kn

Re: [Web-SIG] bytes / unicode

2010-06-23 Thread Antoine Pitrou
On Wed, 23 Jun 2010 14:23:33 -0400 Tres Seaver wrote: > > Perhaps such decisions need revisiting in light of subsequent experience > / pain / learning. E.g: > > - - the repeated inability of the web-sig to converge on appropriate > semantics for a Python3-compatible version of the WSGI spec;