Brian Lloyd writes:
 > Soren Rough writes
 > > ... application level cache ...
 > > ... application objects flushed (including cache)

 > One approach would be to cache your data in the module's 
 > namespace. For ex:
 > 
 > mycache={}
 > 
 > class MyClassThatKeepsGoingAway:
 >   ...
 >   def get_data(self, id):
 >     if mycache.has_key(id):
 >       return mycache[id]
 >     else:
 >       ...
 > 
 > Note that my example is a little contrived, since using a module 
 > variable means that you will have to implement this in a way that 
 > is safe for a multi-threaded environment.
You can use a "SharedResource" for this:

        URL:http://www.dieter.handshake.de/pyprojects/zope/SharedResource.html


Dieter

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to