diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-12-21 10:03:24 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-12-21 10:03:24 (GMT) |
commit | de911b2915476938c66855d91df6fa4bbd77b39f (patch) | |
tree | aba25854f48dd0b7f99ef21d5e86ab7c6ad5a8cb /Doc | |
parent | 12f65d1fefde68ae142b96075917012a61cb8abf (diff) | |
download | cpython-de911b2915476938c66855d91df6fa4bbd77b39f.zip cpython-de911b2915476938c66855d91df6fa4bbd77b39f.tar.gz cpython-de911b2915476938c66855d91df6fa4bbd77b39f.tar.bz2 |
Issue #12708: Add starmap() and starmap_async() methods (similar to itertools.starmap()) to multiprocessing.Pool.
Patch by Hynek Schlawack.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/multiprocessing.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 851b3cf..39ff0a6 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -1669,6 +1669,24 @@ with the :class:`Pool` class. returned iterator should be considered arbitrary. (Only when there is only one worker process is the order guaranteed to be "correct".) + .. method:: starmap(func, iterable[, chunksize]) + + Like :meth:`map` except that the elements of the `iterable` are expected + to be iterables that are unpacked as arguments. + + Hence an `iterable` of `[(1,2), (3, 4)]` results in `[func(1,2), + func(3,4)]`. + + .. versionadded:: 3.3 + + .. method:: starmap_async(func, iterable[, chunksize[, callback[, error_back]]]) + + A combination of :meth:`starmap` and :meth:`map_async` that iterates over + `iterable` of iterables and calls `func` with the iterables unpacked. + Returns a result object. + + .. versionadded:: 3.3 + .. method:: close() Prevents any more tasks from being submitted to the pool. Once all the |