viff

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 diff
     1.1 --- a/viff/runtime.py	Wed May 20 19:35:25 2009 +0200
     1.2 +++ b/viff/runtime.py	Fri May 22 11:23:20 2009 +0200
     1.3 @@ -537,8 +537,8 @@
     1.4          self.add_player(player, None)
     1.5  
     1.6          #: Queue of deferreds and data.
     1.7 -        self.deferred_queue = []
     1.8 -        self.complex_deferred_queue = []
     1.9 +        self.deferred_queue = deque()
    1.10 +        self.complex_deferred_queue = deque()
    1.11          #: Counter for calls of activate_reactor().
    1.12          self.activation_counter = 0
    1.13          #: Record the recursion depth.
    1.14 @@ -812,7 +812,7 @@
    1.15          """Execute the callbacks of the deferreds in *queue*."""
    1.16  
    1.17          while(queue):
    1.18 -            deferred, data = queue.pop(0)
    1.19 +            deferred, data = queue.popleft()
    1.20              deferred.callback(data)
    1.21  
    1.22      def activate_reactor(self):