[Opensrf-commits] r1145 - trunk/src/python/osrf

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Nov 26 17:46:17 EST 2007


Author: erickson
Date: 2007-11-26 17:27:50 -0500 (Mon, 26 Nov 2007)
New Revision: 1145

Modified:
   trunk/src/python/osrf/net.py
Log:
in addition to pushing the received message to the callback, we return the message from recv()

Modified: trunk/src/python/osrf/net.py
===================================================================
--- trunk/src/python/osrf/net.py	2007-11-26 18:20:40 UTC (rev 1144)
+++ trunk/src/python/osrf/net.py	2007-11-26 22:27:50 UTC (rev 1145)
@@ -128,7 +128,6 @@
         If a message is received in 'timeout' seconds, the message is passed to 
         the recvCallback is called and True is returned.  Otherwise, false is returned."""
 
-        msg = None
         if len(self.queue) == 0:
             while timeout >= 0 and len(self.queue) == 0:
                 starttime = time.time()
@@ -141,11 +140,13 @@
                 if not act: self.idle()
 
         # if we've acquired a message, handle it
+        msg = None
         if len(self.queue) > 0:
-            self.recvCallback(self.queue.pop(0))
-            return True
+            msg = self.queue.pop(0)
+            if self.recvCallback:
+                self.recvCallback(msg)
 
-        return False
+        return msg
 
 
 



More information about the opensrf-commits mailing list