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): ...@@ -617,6 +617,16 @@ class Application(object):
serials=(tid, serial), data=data) serials=(tid, serial), data=data)
return result 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 @profiler_decorator
def waitStoreResponses(self, tryToResolveConflict): def waitStoreResponses(self, tryToResolveConflict):
result = [] result = []
...@@ -624,16 +634,10 @@ class Application(object): ...@@ -624,16 +634,10 @@ class Application(object):
resolved_oid_set = set() resolved_oid_set = set()
update = resolved_oid_set.update update = resolved_oid_set.update
local_var = self.local_var local_var = self.local_var
queue = self.local_var.queue
tid = local_var.tid tid = local_var.tid
_waitAnyMessage = self._waitAnyMessage
_handleConflicts = self._handleConflicts _handleConflicts = self._handleConflicts
pending = self.dispatcher.pending
while True: while True:
# Wait for all requests to be answered (or their connection to be self.waitResponses()
# dected as closed)
while pending(queue):
_waitAnyMessage()
if tryToResolveConflict is None: if tryToResolveConflict is None:
break break
conflicts = _handleConflicts(tryToResolveConflict) 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