changeset 1189:d8337973e050

Use deques instead of lists for deferred queues.
author Marcel Keller <mkeller@cs.au.dk>
date Fri, 22 May 2009 11:23:20 +0200
parents 43907e78f95f
children b1ee0d5e116f
files viff/runtime.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/viff/runtime.py	Wed May 20 19:35:25 2009 +0200
+++ b/viff/runtime.py	Fri May 22 11:23:20 2009 +0200
@@ -537,8 +537,8 @@
         self.add_player(player, None)
 
         #: Queue of deferreds and data.
-        self.deferred_queue = []
-        self.complex_deferred_queue = []
+        self.deferred_queue = deque()
+        self.complex_deferred_queue = deque()
         #: Counter for calls of activate_reactor().
         self.activation_counter = 0
         #: Record the recursion depth.
@@ -812,7 +812,7 @@
         """Execute the callbacks of the deferreds in *queue*."""
 
         while(queue):
-            deferred, data = queue.pop(0)
+            deferred, data = queue.popleft()
             deferred.callback(data)
 
     def activate_reactor(self):