On Nov 11, 2007, at 10:22 AM, Mike Orr wrote:

Aha, the perfect time to ask: what is the Registry and what does it do
(besides sounding confusingly like a Windows registry)?  When would a
user want to use it?

The StackedObjectProxy is a thread local object, that for each thread has a list. When a Registry middleware begins, it signals the stacked object proxy's (if there are any already registered with it), that a new Registry context is beginning. Then you can 'register' objects with StackedObjectProxy's, and the Registry tracks what was pushed onto which SOP's. When the Registry middleware exits on the way up, it goes around popping those objects from the SOP's.

So each new Registry middleware, ensures that the SOP's are pointing to the right object during their context. And each SOP is merely a thread-local object that has a list of possible objects it should be pointing to, and proxies access to the last object in that list. There's some more docs and an example here:
http://pylonshq.com/docs/module-paste.registry.html

So it's a Registry, in that you register objects and the SOP's they go to with, and it ensures they're cleaned up at the end of its __call__.

Cheers,
Ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to