Change timeout from milliseconds to seconds in ray.wait. (#3706)

* Change timeout from milliseconds to seconds in ray.wait.

* Suppress warning.

* Suppress warning.

* Add prominent warning in API documentation.
This commit is contained in:
Robert Nishihara
2019-01-08 21:32:08 -08:00
committed by Philipp Moritz
parent 59d861281e
commit d1e21b702e
11 changed files with 58 additions and 37 deletions
+9 -4
View File
@@ -52,8 +52,8 @@ def wait(object_ids, num_returns=1, timeout=None, worker=None):
List like of object IDs for objects that may or may not be ready.
Note that these IDs must be unique.
num_returns (int): The number of object IDs that should be returned.
timeout (int): The maximum amount of time in milliseconds to wait
before returning.
timeout (float): The maximum amount of time in seconds to wait before
returning.
Returns:
A list of object IDs that are ready and a list of the remaining object
@@ -61,6 +61,11 @@ def wait(object_ids, num_returns=1, timeout=None, worker=None):
"""
worker = ray.worker.global_worker if worker is None else worker
if isinstance(object_ids, (tuple, np.ndarray)):
return ray.wait(list(object_ids), num_returns, timeout, worker)
return ray.wait(
list(object_ids),
num_returns=num_returns,
timeout=timeout,
worker=worker)
return ray.wait(object_ids, num_returns, timeout, worker)
return ray.wait(
object_ids, num_returns=num_returns, timeout=timeout, worker=worker)