[Grok-dev] multiple grok wsgi applications possible?

Chris McDonough chrism at plope.com
Wed Dec 17 15:54:46 EST 2008


Kim Luong wrote:
> Martin Aspeli wrote:
>> Martijn Faassen wrote:
>>
>>> I also still think we should have an issue in launchpad with a way to 
>>> reproduce the situation. Martin Aspeli pointed to a possible solution 
>>> that we can then review together. Without something people can bite 
>>> into, we risk forgetting about the issue altogether.
>> Methinks this is it: http://svn.repoze.org/repoze.multiregistry/trunk/
>>
>> Martin
>>
> 
> 
>  From IRC:
> 
> derek|work: mcdonc: how does one use the multiregistry? I'm having
> trouble figuring it out from the docs.
> [3:31pm] mcdonc: derek|work: ooh.. yeah.. that thing.. er, it's broke,
> and i started down a different path; it's likely to be erased
> 

Yes, this package is dead.  But it does demonstrate how you might override
getSiteManager to have it return a thread-local registry, which is 99% of the
trick towards per-app registries.  repoze.bfg already uses this trick internally
to get per-app registries (multiregistry was an attempt to provide *per-path*
registries, which is a further generalization of the pattern; I was trying to
make it possible for traversal to influence the registry in use.. in reality,
the folks complaining in this thread just need per-app registries, as Zope 3
already supplies traversal hooks to get at ZODB local utility registries).

Another place for inspiration is http://pypi.python.org/pypi/z3c.baseregistry/1.0.0

I fear that any code that uses getGlobalSiteManager (read: lots of stuff) as
opposed to more generally written code that uses getSiteManager is doomed to
obtain the actual single global ZCML registry unless zope.component is modified.

- C


More information about the Grok-dev mailing list