[Zope3-dev] using utilities/sites from threads in zope3

Tim Stebbing tjstebbing at gmail.com
Thu Jun 28 21:42:52 EDT 2007


G'day,

I've recently ran into a bit of a problem attempting to use threads in
zope 3.2.1, hooks.getSite() returns None, and any attempt to get a
utility results in a component lookup error within my threads.

I've attempted to pass a site into a thread and set it with
hooks.setSite() but this is apparently not the way to go, I get the
feeling that a thread that needs access to things form the database
probably needs its own connection, context etc.

I'm aware of ITask's but unsure if developers are supposed to use them
for their own purposes? Do these handle setting up of contexts like
db, site, global utils etc? I've googled around a fair bit and been
over all the z3 doco, it would be great if there was a simple howto on
setting up a thread that would have the usual access to various
components.

any help appreciated

-tjs


More information about the Zope3-dev mailing list