PyDocs

Nav

Concurrent Execution

Executor.map

concurrent.futures

method of Executor (source) not WASI
  • Executor.map(fn, *iterables, timeout=None, chunksize=1, buffersize=None)
Returns an iterator equivalent to map(fn, iter).

Args:
    fn: A callable that will take as many arguments as there are
        passed iterables.
    timeout: The maximum number of seconds to wait. If None, then
        there is no limit on the wait time.
    chunksize: The size of the chunks the iterable will be broken
        into before being passed to a child process.  This argument
        is only used by ProcessPoolExecutor; it is ignored by
        ThreadPoolExecutor.
    buffersize: The number of submitted tasks whose results have not
        yet been yielded.  If the buffer is full, iteration over the
        iterables pauses until a result is yielded from the buffer.
        If None, all input elements are eagerly collected, and
        a task is submitted for each.

Returns:
    An iterator equivalent to: map(func, *iterables) but the calls
    may be evaluated out-of-order.

Raises:
    TimeoutError: If the entire result iterator could not be
        generated before the given timeout.
    Exception: If fn(*args) raises for any values.
Changed in 3.5, 3.14
  • 3.5: Added the chunksize parameter.
  • 3.14: Added the buffersize parameter.
0 Examples
No examples for concurrent.futures/Executor.map.
See Also
No see-alsos for concurrent.futures/Executor.map
0 Notes
No notes for Executor.map