# HG changeset patch # User Ram Rachum # Date 1431674920 -10800 # Branch executor_filter # Node ID 10e0b57008fe2442e2e21fca96442e318a4eeb18 # Parent 124e2d1fc787a6f477d642fa4d2a6043950911a6 Documentation for `Executor.filter` diff -r 124e2d1fc787 -r 10e0b57008fe Doc/library/concurrent.futures.rst --- a/Doc/library/concurrent.futures.rst Fri May 15 00:21:00 2015 +0300 +++ b/Doc/library/concurrent.futures.rst Fri May 15 10:28:40 2015 +0300 @@ -50,12 +50,24 @@ exception, then that exception will be raised when its value is retrieved from the iterator. + .. method:: filter(func, iterable, timeout=None) + + Equivalent to :func:`filter(func, iterable) ` except *func* is + executed asynchronously and several calls to *func* may be made + concurrently. The returned iterator raises a :exc:`TimeoutError` if + :meth:`~iterator.__next__` is called and the result isn't available + after *timeout* seconds from the original call to :meth:`Executor.filter`. + *timeout* can be an int or a float. If *timeout* is not specified or + ``None``, there is no limit to the wait time. If a call raises an + exception, then that exception will be raised when its value is + retrieved from the iterator. + .. method:: shutdown(wait=True) Signal the executor that it should free any resources that it is using when the currently pending futures are done executing. Calls to - :meth:`Executor.submit` and :meth:`Executor.map` made after shutdown will - raise :exc:`RuntimeError`. + :meth:`Executor.submit`, :meth:`Executor.map` and :meth:`Executor.filter` + made after shutdown will raise :exc:`RuntimeError`. If *wait* is ``True`` then this method will not return until all the pending futures are done executing and the resources associated with the