[Neo-report] r2390 vincent - /trunk/neo/neoctl/neoctl.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Nov 1 11:59:13 CET 2010
Author: vincent
Date: Mon Nov 1 11:59:11 2010
New Revision: 2390
Log:
Do not raise on disconnection if a response was received.
Modified:
trunk/neo/neoctl/neoctl.py
Modified: trunk/neo/neoctl/neoctl.py
==============================================================================
--- trunk/neo/neoctl/neoctl.py [iso-8859-1] (original)
+++ trunk/neo/neoctl/neoctl.py [iso-8859-1] Mon Nov 1 11:59:11 2010
@@ -53,11 +53,12 @@ class NeoCTL(object):
connection.ask(packet)
response_queue = self.response_queue
assert len(response_queue) == 0
- while len(response_queue) == 0:
- # XXX: this burn the CPU
- self.em.poll(0)
- if not self.connected:
- raise NotReadyException, 'Connection closed'
+ while self.connected:
+ self.em.poll(1)
+ if response_queue:
+ break
+ else:
+ raise NotReadyException, 'Connection closed'
response = response_queue.pop()
if response[0] == Packets.Error and \
response[1] == ErrorCodes.NOT_READY:
More information about the Neo-report
mailing list