Update incorrect detached actor docs (#8930)

This commit is contained in:
SangBin Cho
2020-06-15 12:31:02 -05:00
committed by GitHub
parent 1583cd14ef
commit 3ca0e6f636
+2 -17
View File
@@ -251,7 +251,7 @@ For example, you can instantiate and register a persistent actor as follows:
.. code-block:: python
counter = Counter.options(name="CounterActor", detached=True).remote()
counter = Counter.options(name="CounterActor").remote()
The CounterActor will be kept alive even after the driver running above script
exits. Therefore it is possible to run the following script in a different
@@ -259,20 +259,5 @@ driver:
.. code-block:: python
counter = ray.util.get_actor("CounterActor")
counter = ray.get_actor("CounterActor")
print(ray.get(counter.get_counter.remote()))
Note that just creating a named actor is allowed, this actor will be cleaned
up after driver exits:
.. code-block:: python
Counter.options(name="CounterActor").remote()
However, creating a detached actor without name is not allowed because there
will be no way to retrieve the actor handle and the resource is leaked.
.. code-block:: python
# Can't do this!
Counter.options(detached=True).remote()