Rewrite the async api documentation (#6936)

* Rewrite the async api documentation

* Apply suggestions from code review

Co-Authored-By: Edward Oakes <ed.nmi.oakes@gmail.com>

* clearify comment

* Add quickstart

* Add reference for async in ray.get ray.wait docstring

Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com>
This commit is contained in:
Simon Mo
2020-01-30 09:34:09 -08:00
committed by GitHub
parent 11d90d6d0c
commit 1e3a34b223
2 changed files with 107 additions and 59 deletions
+7
View File
@@ -1459,6 +1459,10 @@ def get(object_ids, timeout=None):
object has been created). If object_ids is a list, then the objects
corresponding to each object in the list will be returned.
This method will error will error if it's running inside async context,
you can use ``await object_id`` instead of ``ray.get(object_id)``. For
a list of object ids, you can use ``await asyncio.gather(*object_ids)``.
Args:
object_ids: Object ID of the object to get or a list of object IDs to
get.
@@ -1573,6 +1577,9 @@ def wait(object_ids, num_returns=1, timeout=None):
precede B in the ready list. This also holds true if A and B are both in
the remaining list.
This method will error if it's running inside an async context. Instead of
``ray.wait(object_ids)``, you can use ``await asyncio.wait(object_ids)``.
Args:
object_ids (List[ObjectID]): List of object IDs for objects that may or
may not be ready. Note that these IDs must be unique.