vendor/zasync/1.1

changeset 30:3a77b497a6cd 1.1-nux 0.0.5-1.1-nux

Fix in getAcceptedCalls method: return deferred objects sorted by creation date to preserve FIFO order.
author rspivak
date Tue, 16 Jan 2007 21:15:06 +0000
parents c4481c2a7318
children bb0262d15107
files CHANGES manager.py
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/CHANGES
     1.2 +++ b/CHANGES
     1.3 @@ -6,7 +6,9 @@
     1.4  -
     1.5  Bug fixes:
     1.6  ~~~~~~~~~~
     1.7 --
     1.8 +- Fix in getAcceptedCalls method: return deferred objects sorted by creation
     1.9 +  date to preserve FIFO order.
    1.10 +
    1.11  New internal features:
    1.12  ~~~~~~~~~~~~~~~~~~~~~~
    1.13  -
     2.1 --- a/manager.py
     2.2 +++ b/manager.py
     2.3 @@ -780,7 +780,16 @@
     2.4  
     2.5      security.declarePrivate('getAcceptedCalls')
     2.6      def getAcceptedCalls(self):
     2.7 -        return self._accepted.values()
     2.8 +        """Return deferred objects sorted by creation date to preserve FIFO
     2.9 +        order.
    2.10 +
    2.11 +        This method is called when zasync is restarted to handle past elements
    2.12 +        from 'accepted' queue.
    2.13 +        """
    2.14 +        res = [(val.creation_date, val) for val in self._accepted.values()]
    2.15 +        res.sort()
    2.16 +        res = [val for sort, val in res]
    2.17 +        return res
    2.18  
    2.19      security.declarePrivate('heartbeat')
    2.20      def heartbeat(self):