[Zope-CVS] CVS: Products/ExternalMount - __init__.py:1.2

Jim Fulton jim@zope.com
Wed, 28 Aug 2002 14:19:41 -0400


Shane Hathaway wrote:
> Update of /cvs-repository/Products/ExternalMount
> In directory cvs.zope.org:/tmp/cvs-serv9374
> 
> Modified Files:
> 	__init__.py 
> Log Message:
> Workaround for a bad interaction between ZEO and mounted databases: if
> the main database is not a ZEO client, the unpatched version of
> asyncore.loop() gets run instead of ThreadedAsync's monkey-patched version.
> The real problem is ThreadedAsync, but for now we can just make sure
> the patched version of the asyncore.loop() gets run all the time by
> importing ThreadedAsync early.

The real problem is the asyncore main loop. The author never expected
anyone to actually run it, but to use their own custom loop.

Really, Zope should use ThreadedAsync. (Or Zope and ZEO should use something
like it.)

Jim


> 
> === Products/ExternalMount/__init__.py 1.1.1.1 => 1.2 ===
> --- Products/ExternalMount/__init__.py:1.1.1.1	Wed Aug 21 16:11:25 2002
> +++ Products/ExternalMount/__init__.py	Wed Aug 28 13:49:02 2002
> @@ -83,7 +83,15 @@
>  # 
>  ##############################################################################
>  
> +# importing ThreadedAsync has the side effect of patching asyncore so
> +# that loop callbacks get invoked.  You need this to
> +# mount a ZEO client connection if the main database is not a ZEO client.
> +# Otherwise ZEO never receives the message telling it to start use the
> +# main async loop.
> +import ThreadedAsync
> +
>  import ExternalMount
> +
>  
>  def initialize(context):
>  
> 
> 
> _______________________________________________
> Zope-CVS maillist  -  Zope-CVS@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cvs
> 
> Zope CVS instructions: http://dev.zope.org/CVS
> 



-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org