I'm writing client code that uses ZODB over a ZEO connection. In order
not to have to call connection.sync() to synchronise the cache with the
server I wish to provide the ZEO client with an asyncore mainloop to
which it can attach itself. No matter how I do this, however, my clients
do not seem to be processing cache invalidation/update messages
My client code does not make use of asyncore itself so the thread is
started especially for ZEO's use. I've tried starting the loop thread
*after* getting the ZEO connection:
self.env.sys.logger.info("Asyncore loop starting")
self.env.sys.logger.error("Asyncore loop quitting: %s"%str(ex))
self.env.sys.logger.info("Asycore loop ended")
addr = host, port
db = DB(self.storage)
conn = self.db.open()
mt = AsyncoreRunner(self.env)
... and I've tried starting it BEFORE getting the connection (providing
a dummy dispatcher so that the asyncore.loop() does not return immediately).
In either case, if I run two clients the following does not work where I
would imagine it should if the messages were being processed on the
root = conn.root()
root['test'] = 20
10 <----- Not 20!
20 <----- now it is!
Have I misunderstood things very badly? Am I approaching things too
I have googled and searched a lot of documentation but I just can't find
the key to my problem! Here's hoping that someone on this list can help!
Many thanks in advance,
For more information about ZODB, see the ZODB Wiki:
ZODB-Dev mailing list - ZODB-Dev@zope.org