[ZODB-Dev] Quick ZODB connection synch question

Shane Hathaway shane at zope.com
Mon Sep 29 11:00:24 EDT 2003


Tim Peters wrote:
> [Christian Reis]
> 
>>>However, I think Nic (as I) was actually interested in finding out
>>>how to run a ZEO setup that doesn't use an asyncore loop :-)
> 
> 
> [Shane Hathaway]
> 
>>sync() will do it.  Is sync() not what you want?
> 
> 
> Nicholas wants an asyncore mainloop, in a non-Zope ZEO app, but doesn't know
> how to set one up:
> 
>     what I was asking for was a code example setting up the use of
>     the asyncore mainloop,
> 
> Maybe everyone who knows how to do that can't believe that someone else
> doesn't <wink>.

Is this the answer you're looking for, Nicholas?

   import asyncore
   asyncore.loop()

If you need to run that in a separate thread:

   import thread, asyncore
   thread.start_new_thread(asyncore.loop, ())

Shane




More information about the ZODB-Dev mailing list