diff --git a/doc/source/advanced.rst b/doc/source/advanced.rst index b44d84433..3b6037c93 100644 --- a/doc/source/advanced.rst +++ b/doc/source/advanced.rst @@ -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()