[Neo-report] r2028 vincent - /trunk/neo/client/app.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Apr 26 16:07:02 CEST 2010


Author: vincent
Date: Mon Apr 26 16:07:01 2010
New Revision: 2028

Log:
Test if there are pending message when looping.

This prevents from having an endless wait on "get" if the last connection
from which we were expecting answers got interrupted.
Note that this method will not raise any error related to this.

Modified:
    trunk/neo/client/app.py

Modified: trunk/neo/client/app.py
==============================================================================
--- trunk/neo/client/app.py [iso-8859-1] (original)
+++ trunk/neo/client/app.py [iso-8859-1] Mon Apr 26 16:07:01 2010
@@ -212,9 +212,11 @@
             If True (default), will block until at least one packet was
             received.
         """
-        get = self.local_var.queue.get
+        pending = self.dispatcher.pending
+        queue = self.local_var.queue
+        get = queue.get
         _handlePacket = self._handlePacket
-        while True:
+        while pending(queue):
             try:
                 conn, packet = get(block)
             except Empty:





More information about the Neo-report mailing list