@@ -2536,7 +2536,7 @@ with the :class:`Pool` class.
25362536 Callbacks should complete immediately since otherwise the thread which
25372537 handles the results will get blocked.
25382538
2539- .. method :: imap(func, iterable[ , chunksize] )
2539+ .. method :: imap(func, iterable, chunksize=1, *, buffersize=None )
25402540
25412541 A lazier version of :meth: `.map `.
25422542
@@ -2550,12 +2550,27 @@ with the :class:`Pool` class.
25502550 ``next(timeout) `` will raise :exc: `multiprocessing.TimeoutError ` if the
25512551 result cannot be returned within *timeout * seconds.
25522552
2553- .. method :: imap_unordered(func, iterable[, chunksize])
2553+ The *iterable * is collected immediately rather than lazily, unless a
2554+ *buffersize * is specified to limit the number of submitted tasks whose
2555+ results have not yet been yielded. If the buffer is full, iteration over
2556+ the *iterables * pauses until a result is yielded from the buffer.
2557+ To fully utilize pool's capacity when using this feature,
2558+ set *buffersize * at least to the number of processes in pool
2559+ (to consume *iterable * as you go), or even higher
2560+ (to prefetch the next ``N=buffersize-processes `` arguments).
2561+
2562+ .. versionchanged :: next
2563+ Added the *buffersize * parameter.
2564+
2565+ .. method :: imap_unordered(func, iterable, chunksize=1, *, buffersize=None)
25542566
25552567 The same as :meth: `imap ` except that the ordering of the results from the
25562568 returned iterator should be considered arbitrary. (Only when there is
25572569 only one worker process is the order guaranteed to be "correct".)
25582570
2571+ .. versionchanged :: next
2572+ Added the *buffersize * parameter.
2573+
25592574 .. method :: starmap(func, iterable[, chunksize])
25602575
25612576 Like :meth: `~multiprocessing.pool.Pool.map ` except that the
0 commit comments