threading.local equivalent for twisted.web?

Posted by defnull on Stack Overflow See other posts from Stack Overflow or by defnull
Published on 2010-05-17T11:43:46Z Indexed on 2010/05/17 13:10 UTC
Read the original article Hit count: 246

Filed under:
|
|

In asynchronous environments, threading.local is not guaranteed to be context-local anymore, because several contexts may coexist within a single thread. Most asynchronous frameworks (gevent, eventlet) provide a get_current_context() functionality to identify the current context. Some offer a way to monkey-patch threading.local so it is local to 'greenthreads' or other framework-specific contexts. I cannot find such a functionality in the twisted documentation. How do I do this?

© Stack Overflow or respective owner

Related posts about python

Related posts about twisted