mirror of
https://github.com/wassname/ray.git
synced 2026-07-24 13:20:22 +08:00
[Docs] Add Cancelation to main docs. (#8508)
* Update walkthrough.rst * Adding example * Better example * Better example * Adding Ray Kill Info
This commit is contained in:
@@ -168,6 +168,20 @@ Further, remote functions can return multiple object IDs.
|
||||
|
||||
a_id, b_id, c_id = return_multiple.remote()
|
||||
|
||||
Remote functions can be canceled by calling ``ray.cancel`` on the returned Object ID. Remote actor functions can be stopped by killing the actor using the ``ray.kill`` interface.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@ray.remote
|
||||
def blocking_operation():
|
||||
time.sleep(10e6)
|
||||
return 100
|
||||
|
||||
obj_id = blocking_operation.remote()
|
||||
ray.cancel(obj_id)
|
||||
|
||||
.. autofunction:: ray.cancel
|
||||
:noindex:
|
||||
|
||||
Objects in Ray
|
||||
--------------
|
||||
|
||||
Reference in New Issue
Block a user