##// END OF EJS Templates
speed up AsyncResult._wait_for_outputs (don't waste 0.01 seconds)...
Anton Akhmerov -
Show More
@@ -452,14 +452,14 b' class AsyncResult(object):'
452 timeout = -1
452 timeout = -1
453
453
454 tic = time.time()
454 tic = time.time()
455 self._client._flush_iopub(self._client._iopub_socket)
455 while True:
456 self._outputs_ready = all(md['outputs_ready'] for md in self._metadata)
457 while not self._outputs_ready:
458 time.sleep(0.01)
459 self._client._flush_iopub(self._client._iopub_socket)
456 self._client._flush_iopub(self._client._iopub_socket)
460 self._outputs_ready = all(md['outputs_ready'] for md in self._metadata)
457 self._outputs_ready = all(md['outputs_ready']
461 if timeout >= 0 and time.time() > tic + timeout:
458 for md in self._metadata)
459 if self._outputs_ready or \
460 (timeout >= 0 and time.time() > tic + timeout):
462 break
461 break
462 time.sleep(0.01)
463
463
464 @check_ready
464 @check_ready
465 def display_outputs(self, groupby="type"):
465 def display_outputs(self, groupby="type"):
General Comments 0
You need to be logged in to leave comments. Login now