Commit 3d13e593 authored by Vincent Pelletier's avatar Vincent Pelletier

Separate code to wait for all pending responses from waitStoreResponses.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1934 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 77ec9df2
......@@ -617,6 +617,16 @@ class Application(object):
serials=(tid, serial), data=data)
return result
@profiler_decorator
def waitResponses(self):
"""Wait for all requests to be answered (or their connection to be
dected as closed)"""
queue = self.local_var.queue
pending = self.dispatcher.pending
_waitAnyMessage = self._waitAnyMessage
while pending(queue):
_waitAnyMessage()
@profiler_decorator
def waitStoreResponses(self, tryToResolveConflict):
result = []
......@@ -624,16 +634,10 @@ class Application(object):
resolved_oid_set = set()
update = resolved_oid_set.update
local_var = self.local_var
queue = self.local_var.queue
tid = local_var.tid
_waitAnyMessage = self._waitAnyMessage
_handleConflicts = self._handleConflicts
pending = self.dispatcher.pending
while True:
# Wait for all requests to be answered (or their connection to be
# dected as closed)
while pending(queue):
_waitAnyMessage()
self.waitResponses()
if tryToResolveConflict is None:
break
conflicts = _handleConflicts(tryToResolveConflict)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment