[Zope-dev] Deciphering Zope Comments
Wichert Akkerman
wichert at wiggy.net
Wed Jun 4 03:40:18 EDT 2008
Previously Shane Hathaway wrote:
> I think I want to use a threading.local as my site manager. That way, I
> can use a different configuration for each WSGI app even if several apps
> run in different threads of a single Python interpreter. It looks like
> the zope.app.component.hooks module does something like what I want, but
> that module is complicated and lacks comments in the places that matter,
> so I'm not quite sure what it accomplishes. I'll add comments to that
> module if anyone can explain it fully.
You can also use a paste.registry StackedObjectProxy to provide access
to a thread local site manager via the standard wsgi environ. That
certainly fits well with the WSGI model and other frameworks such as
Pylons and Turbogears use it. I'm not sure if Zope3 exposes that
properly though. Admitedly paste.registry is not the best documented
code either; some cleanup there is still useful but the ideal model has
not been worked out yet.
> That led me to the zope.thread module, which is apparently deprecated
> already, yet zope.app.component still depends on it. Is that an
> hysterical accident?
I only learned yesterday that zope.thread is now basically just a
wrapper around python 2.4's threading module so you can use that
directly.
Wichert.
--
Wichert Akkerman <wichert at wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
More information about the Zope-Dev
mailing list