python/ray/actor.py
def exit_actor():
    """Intentionally exit the current actor.

    This function is used to disconnect an actor and exit the worker.
    Any ``atexit`` handlers installed in the actor will be run.

    Raises:
        Exception: An exception is raised if this is a driver or this
            worker is not an actor.
    """
    worker = ray.worker.global_worker
    if worker.mode == ray.WORKER_MODE and not worker.actor_id.is_nil():
        # Intentionally disconnect the core worker from the raylet so the
        # raylet won't push an error message to the driver.
        ray.worker.disconnect()
        # Disconnect global state from GCS.
        ray.state.state.disconnect()

        # In asyncio actor mode, we can't raise SystemExit because it will just
        # quit the asycnio event loop thread, not the main thread. Instead, we
        # raise a custom error to the main thread to tell it to exit.
        if worker.core_worker.current_actor_is_asyncio():
            raise AsyncioActorExit()

        # Set a flag to indicate this is an intentional actor exit. This
        # reduces log verbosity.
        exit = SystemExit(0)
        exit.is_ray_terminate = True
        raise exit
        assert False, "This process should have terminated."
    else:
        raise TypeError("exit_actor called on a non-actor worker.")
Intentionally exit the current actor.

    This function is used to disconnect an actor and exit the worker.
    Any ``atexit`` handlers installed in the actor will be run.

    Raises:
        Exception: An exception is raised if this is a driver or this
            worker is not an actor.
    
Intentionally exit the current actor.
This function is used to disconnect an actor and exit the worker.
Any ``atexit`` handlers installed in the actor will be run.
Intentionally exit the current actor . This function is used to disconnect an actor and exit the worker . Any ` ` atexit ` ` handlers installed in the actor will be run .
def exit_actor():
    worker = ray.worker.global_worker
    if worker.mode == ray.WORKER_MODE and not worker.actor_id.is_nil():
        ray.worker.disconnect()
        ray.state.state.disconnect()
        if worker.core_worker.current_actor_is_asyncio():
            raise AsyncioActorExit()
        exit = SystemExit(0)
        exit.is_ray_terminate = True
        raise exit
        assert False, "This process should have terminated."
    else:
        raise TypeError("exit_actor called on a non-actor worker.")
def exit_actor ( ) : worker = ray . worker . global_worker if worker . mode == ray . WORKER_MODE and not worker . actor_id . is_nil ( ) : ray . worker . disconnect ( ) ray . state . state . disconnect ( ) if worker . core_worker . current_actor_is_asyncio ( ) : raise AsyncioActorExit ( ) exit = SystemExit ( 0 ) exit . is_ray_terminate = True raise exit assert False , "This process should have terminated." else : raise TypeError ( "exit_actor called on a non-actor worker." )
Intentionally exit the current actor.
Intentionally exit the current actor .
"""Intentionally exit the current actor.

    This function is used to disconnect an actor and exit the worker.
    Any ``atexit`` handlers installed in the actor will be run.

    Raises:
        Exception: An exception is raised if this is a driver or this
            worker is not an actor.
    """ # Intentionally disconnect the core worker from the raylet so the # raylet won't push an error message to the driver. # Disconnect global state from GCS. # In asyncio actor mode, we can't raise SystemExit because it will just # quit the asycnio event loop thread, not the main thread. Instead, we # raise a custom error to the main thread to tell it to exit. # Set a flag to indicate this is an intentional actor exit. This # reduces log verbosity.
An exception is raised if this is a driver or this
worker is not an actor.
An exception is raised if this is a driver or this worker is not an actor .
Exception