[Neo-report] r1770 vincent - /trunk/neo/dispatcher.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Feb 16 12:07:36 CET 2010


Author: vincent
Date: Tue Feb 16 12:07:32 2010
New Revision: 1770

Log:
Avoid pushing fake packet more than once per queue for a given connection.

Modified:
    trunk/neo/dispatcher.py

Modified: trunk/neo/dispatcher.py
==============================================================================
--- trunk/neo/dispatcher.py [iso-8859-1] (original)
+++ trunk/neo/dispatcher.py [iso-8859-1] Tue Feb 16 12:07:32 2010
@@ -70,9 +70,12 @@
         try:
             message_table = self.message_table.pop(id(conn), EMPTY)
         finally:
-            self.message_table_lock_release()
+        notified_set = set()
         for queue in message_table.itervalues():
-            queue.put((conn, None))
+            queue_id = id(queue)
+            if queue_id not in notified_set:
+                queue.put((conn, None))
+                notified_set.add(queue_id)
 
     def registered(self, conn):
         """Check if a connection is registered into message table."""





More information about the Neo-report mailing list