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 exactly what I did in the
wrap_threading_local_with_coro_local here:
http://donovanpreston.com:8888/eventlet/file/b6f9627e88df/eventlet/util.py
However this will not work if you have an asynchronous server that
does not make use of greenlets.
Exactly, which is why I am proposing just standardizing something that
does exactly what people use threading.local for, but whose
implementation is pluggable by the wsgi server.
Donovan
_______________________________________________
Web-SIG mailing list
Web-SIG@python.org
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe:
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com