mirror of
https://github.com/wassname/ray.git
synced 2026-07-19 11:27:32 +08:00
Update incorrect detached actor docs (#8930)
This commit is contained in:
+2
-17
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user