Re: [Web-SIG] Alternative to threading.local, based on the stack

2008-07-08 Thread Ian Bicking
Phillip J. Eby wrote: Obviously plenty of people have a desire to have a place to store request-local data without passing the environment everywhere. Using threading.local is a good way to do that, unless the server is not using one thread per request. Giving people an interface to write to tha

Re: [Web-SIG] Alternative to threading.local, based on the stack

2008-07-08 Thread Robert Brewer
Donovan Preston wrote: > On Jul 8, 2008, at 2:31 PM, Phillip J. Eby wrote: > > Er, and how do you propose people *access* that interface rather > > than a specific implementation of it? Wouldn't we need to pass it > > in the environ, thereby rendering the whole thing even more > > obviously moot?

Re: [Web-SIG] Alternative to threading.local, based on the stack

2008-07-08 Thread Donovan Preston
On Jul 8, 2008, at 2:31 PM, Phillip J. Eby wrote: At 11:35 AM 7/8/2008 -0700, Donovan Preston wrote: Obviously plenty of people have a desire to have a place to store request-local data without passing the environment everywhere. Using threading.local is a good way to do that, unless the se

Re: [Web-SIG] Alternative to threading.local, based on the stack

2008-07-08 Thread Phillip J. Eby
At 11:35 AM 7/8/2008 -0700, Donovan Preston wrote: On Jul 7, 2008, at 6:11 PM, Phillip J. Eby wrote: At 02:12 PM 7/7/2008 -0700, Donovan Preston wrote: It seems to me that what is really needed here is an extension of wsgi that specifies how to get, set, and list request local storage, and for

Re: [Web-SIG] Alternative to threading.local, based on the stack

2008-07-08 Thread Manlio Perillo
Donovan Preston ha scritto: On Jul 8, 2008, at 11:45 AM, Manlio Perillo wrote: Using greenlets, there is always a current greenlet, so you can use this for local storage. A library function can check if there is an active greenlet, and use it as data key; otherwise it will use the current t

Re: [Web-SIG] Alternative to threading.local, based on the stack

2008-07-08 Thread Donovan Preston
On Jul 8, 2008, at 11:45 AM, Manlio Perillo wrote: Using greenlets, there is always a current greenlet, so you can use this for local storage. A library function can check if there is an active greenlet, and use it as data key; otherwise it will use the current thread id. Yes, this is ex

Re: [Web-SIG] Alternative to threading.local, based on the stack

2008-07-08 Thread Manlio Perillo
Donovan Preston ha scritto: On Jul 7, 2008, at 6:11 PM, Phillip J. Eby wrote: At 02:12 PM 7/7/2008 -0700, Donovan Preston wrote: It seems to me that what is really needed here is an extension of wsgi that specifies how to get, set, and list request local storage, and for people to use that in

Re: [Web-SIG] Alternative to threading.local, based on the stack

2008-07-08 Thread Donovan Preston
On Jul 7, 2008, at 6:11 PM, Phillip J. Eby wrote: At 02:12 PM 7/7/2008 -0700, Donovan Preston wrote: It seems to me that what is really needed here is an extension of wsgi that specifies how to get, set, and list request local storage, and for people to use that instead of the threadlocal mo

Re: [Web-SIG] help with the implementation of a WSGI middleware

2008-07-08 Thread Manlio Perillo
Phillip J. Eby ha scritto: At 11:21 PM 7/7/2008 +0200, Manlio Perillo wrote: So this is not a "bad" middleware, IMHO. True, but it's part of the application, rather than being transparent. Ok, I agree. Does this means that such non trasparent middlewares must not be inserted inside the "g

Re: [Web-SIG] Alternative to threading.local, based on the stack

2008-07-08 Thread Manlio Perillo
Donovan Preston ha scritto: [...] It seems to me that what is really needed here is an extension of wsgi that specifies how to get, set, and list request local storage, and for people to use that instead of the threadlocal module. There seems to be something that I don't understand: why not