mirror of
https://github.com/wassname/ray.git
synced 2026-10-29 13:30:42 +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:
1 parent
cd706f40c4
commit
f56b3be916
1 file changed
+14
@@ -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