MCPcopy Index your code
hub / github.com/python/cpython / _set

Method _set

Lib/multiprocessing/pool.py:809–831  ·  view source on GitHub ↗
(self, i, success_result)

Source from the content-addressed store, hash-verified

807 self._number_left = length//chunksize + bool(length % chunksize)
808
809 def _set(self, i, success_result):
810 self._number_left -= 1
811 success, result = success_result
812 if success and self._success:
813 self._value[i*self._chunksize:(i+1)*self._chunksize] = result
814 if self._number_left == 0:
815 if self._callback:
816 self._callback(self._value)
817 del self._cache[self._job]
818 self._event.set()
819 self._pool = None
820 else:
821 if not success and self._success:
822 # only store first exception
823 self._success = False
824 self._value = result
825 if self._number_left == 0:
826 # only consider the result ready once all jobs are done
827 if self._error_callback:
828 self._error_callback(self._value)
829 del self._cache[self._job]
830 self._event.set()
831 self._pool = None
832
833#
834# Class whose instances are returned by `Pool.imap()`

Callers 2

_handle_tasksMethod · 0.45
_handle_resultsMethod · 0.45

Calls 1

setMethod · 0.45

Tested by

no test coverage detected