Skip to content

Commit

Permalink
Clarified concurrent.futures section in client.rst (#8048)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Augspurger <[email protected]>
  • Loading branch information
mercyo12 and TomAugspurger authored Aug 1, 2023
1 parent 31af5c0 commit 405c011
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions docs/source/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ many function calls with the ``client.map`` method
These results live on distributed workers.

We can submit tasks on futures. The function will go to the machine where the
futures are stored and run on the result once it has completed.

.. code-block:: python
>>> y = client.submit(inc, x) # Submit on x, a Future
>>> total = client.submit(sum, L) # Map on L, a list of Futures
We gather back the results using either the ``Future.result`` method for single
futures or ``client.gather`` method for many futures at once.

Expand All @@ -71,6 +63,16 @@ remotely with functions like ``submit``, ``map``, ``get`` and ``compute``.
See :doc:`efficiency <efficiency>` for more information on efficient use of
distributed.

We can submit tasks on futures and use futures as inputs. The function will go to
the machine where the futures are stored and run on the result once it has completed.

.. code-block:: python
>>> y = client.submit(inc, x) # Submit on x, a Future
>>> total = client.submit(sum, L) # Submit on L, a list of Futures
>>> y.result()
12
Dask
----
Expand Down

0 comments on commit 405c011

Please sign in to comment.