[ZODB-Dev] strange synchronization bug
Nicholas Henke
henken@seas.upenn.edu
Thu, 29 Aug 2002 15:47:06 -0400 (EDT)
On Thu, 29 Aug 2002, Jeremy Hylton wrote:
> ZEO does do this automatically if you are running an application that
> uses an asyncore mainloop. When one client modifies an object, the
> server sends an invalidation message to all the other clients. If any
> of the other clients have a copy of the object loaded, they reload the
> object.
>
> The client and storage are implemented using asyncore, which means
> they don't do any I/O unless asyncore.loop() or asyncore.poll() are
> called. The invalidation messages will sit in the socket buffer until
> the application calls one of these functions. In Zope, we have a
> separate thread that runs asyncore.loop().
>
> If your application doesn't run an asyncore mainloop, then
> invalidation messages will only be read when the application calls
> into ZEO. When it calls load() (or anything else), load() will
> implicitly call asyncore.poll(), which will process the invalidation
> messages.
>
Ok -- so I need to use asyncore in my application. Do I just need to call
asyncore.poll() everyonce in a while -- I guess use that instead of sync()
?
> Neil asked: "Where'd the sync() method go?" Earlier versions of ZEO
> had a sync() method that non-asyncore applications could call the
> check for pending I/O. Guido suggests that we give it a better name.
> Tk calls this update(), apparently.
Is this coming back -- or do all ZODB/ZEO applications now have to use
asyncore?
Nic