@@ -2448,7 +2448,7 @@ with the :class:`Pool` class.
2448
2448
Callbacks should complete immediately since otherwise the thread which
2449
2449
handles the results will get blocked.
2450
2450
2451
- .. method :: imap(func, iterable[, chunksize])
2451
+ .. method :: imap(func, iterable[, chunksize[, buffersize] ])
2452
2452
2453
2453
A lazier version of :meth: `.map `.
2454
2454
@@ -2462,7 +2462,18 @@ with the :class:`Pool` class.
2462
2462
``next(timeout) `` will raise :exc: `multiprocessing.TimeoutError ` if the
2463
2463
result cannot be returned within *timeout * seconds.
2464
2464
2465
- .. method :: imap_unordered(func, iterable[, chunksize])
2465
+ The *iterable * is collected immediately rather than lazily, unless a
2466
+ *buffersize * is specified to limit the number of submitted tasks whose
2467
+ results have not yet been yielded. If the buffer is full, iteration over
2468
+ the *iterables * pauses until a result is yielded from the buffer.
2469
+ To fully utilize pool's capacity, set *buffersize * to the number of
2470
+ processes in pool (to consume *iterable * as you go) or even higher
2471
+ (to prefetch *buffersize - processes * arguments).
2472
+
2473
+ .. versionadded :: 3.15
2474
+ Added the *buffersize * parameter.
2475
+
2476
+ .. method :: imap_unordered(func, iterable[, chunksize[, buffersize]])
2466
2477
2467
2478
The same as :meth: `imap ` except that the ordering of the results from the
2468
2479
returned iterator should be considered arbitrary. (Only when there is
0 commit comments