On Saturday 22 October 2005 13:01, Chris Lehmann wrote:
> I have a utility that needs to start several threads when zope starts
> up. What is the best way to accomplish this?
>
> So far I have tried to use the IDatabaseOpenedWithRoot and
> IProcessStarting events but when I try and register them with the
> following code, my handlers do not get called. Code from the
> constructor of my utility class:
>
> zapi.getGlobalSiteManager().subscribe([IProcessStartingEvent],None,
> self.onStartup)
>
> What am I doing wrong?
You need to make this registration using ZCML. Having this code in the utility
constructor is far too late.
<subscriber
for="...IProcessStartingEvent"
handler="...onStartup" />
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
_______________________________________________
Zope3-users mailing list
[email protected]
http://mail.zope.org/mailman/listinfo/zope3-users