python/ray/actor.py
def _actor_method_call(
        self,
        method_name,
        args=None,
        kwargs=None,
        name="",
        num_returns=None,
        concurrency_group_name=None,
    ):
        """Method execution stub for an actor handle.

        This is the function that executes when
        `actor.method_name.remote(*args, **kwargs)` is called. Instead of
        executing locally, the method is packaged as a task and scheduled
        to the remote actor instance.

        Args:
            method_name: The name of the actor method to execute.
            args: A list of arguments for the actor method.
            kwargs: A dictionary of keyword arguments for the actor method.
            name (str): The name to give the actor method call task.
            num_returns (int): The number of return values for the method.

        Returns:
            object_refs: A list of object refs returned by the remote actor
                method.
        """
        worker = ray.worker.global_worker

        args = args or []
        kwargs = kwargs or {}
        if self._ray_is_cross_language:
            list_args = cross_language.format_args(worker, args, kwargs)
            function_descriptor = cross_language.get_function_descriptor_for_actor_method(  # noqa: E501
                self._ray_actor_language,
                self._ray_actor_creation_function_descriptor,
                method_name,
                # The signature for xlang should be "{length_of_arguments}" to handle
                # overloaded methods.
                signature=str(len(args) + len(kwargs)),
            )
        else:
            function_signature = self._ray_method_signatures[method_name]

            if not args and not kwargs and not function_signature:
                list_args = []
            else:
                list_args = signature.flatten_args(function_signature, args, kwargs)
            function_descriptor = self._ray_function_descriptor[method_name]

        if worker.mode == ray.LOCAL_MODE:
            assert (
                not self._ray_is_cross_language
            ), "Cross language remote actor method cannot be executed locally."

        object_refs = worker.core_worker.submit_actor_task(
            self._ray_actor_language,
            self._ray_actor_id,
            function_descriptor,
            list_args,
            name,
            num_returns,
            self._ray_actor_method_cpus,
            concurrency_group_name if concurrency_group_name is not None else b"",
        )

        if len(object_refs) == 1:
            object_refs = object_refs[0]
        elif len(object_refs) == 0:
            object_refs = None

        return object_refs
Method execution stub for an actor handle.

        This is the function that executes when
        `actor.method_name.remote(*args, **kwargs)` is called. Instead of
        executing locally, the method is packaged as a task and scheduled
        to the remote actor instance.

        Args:
            method_name: The name of the actor method to execute.
            args: A list of arguments for the actor method.
            kwargs: A dictionary of keyword arguments for the actor method.
            name (str): The name to give the actor method call task.
            num_returns (int): The number of return values for the method.

        Returns:
            object_refs: A list of object refs returned by the remote actor
                method.
        
Method execution stub for an actor handle.
This is the function that executes when
`actor.method_name.remote(*args, **kwargs)` is called. Instead of
executing locally, the method is packaged as a task and scheduled
to the remote actor instance.
Method execution stub for an actor handle . This is the function that executes when ` actor . method_name . remote ( * args ** kwargs ) ` is called . Instead of executing locally the method is packaged as a task and scheduled to the remote actor instance .
def _actor_method_call(
        self,
        method_name,
        args=None,
        kwargs=None,
        name="",
        num_returns=None,
        concurrency_group_name=None,
    ):
        worker = ray.worker.global_worker
        args = args or []
        kwargs = kwargs or {}
        if self._ray_is_cross_language:
            list_args = cross_language.format_args(worker, args, kwargs)
            function_descriptor = cross_language.get_function_descriptor_for_actor_method(  
                self._ray_actor_language,
                self._ray_actor_creation_function_descriptor,
                method_name,
                signature=str(len(args) + len(kwargs)),
            )
        else:
            function_signature = self._ray_method_signatures[method_name]
            if not args and not kwargs and not function_signature:
                list_args = []
            else:
                list_args = signature.flatten_args(function_signature, args, kwargs)
            function_descriptor = self._ray_function_descriptor[method_name]
        if worker.mode == ray.LOCAL_MODE:
            assert (
                not self._ray_is_cross_language
            ), "Cross language remote actor method cannot be executed locally."
        object_refs = worker.core_worker.submit_actor_task(
            self._ray_actor_language,
            self._ray_actor_id,
            function_descriptor,
            list_args,
            name,
            num_returns,
            self._ray_actor_method_cpus,
            concurrency_group_name if concurrency_group_name is not None else b"",
        )
        if len(object_refs) == 1:
            object_refs = object_refs[0]
        elif len(object_refs) == 0:
            object_refs = None
        return object_refs
def _actor_method_call ( self , method_name , args = None , kwargs = None , name = "" , num_returns = None , concurrency_group_name = None , ) : worker = ray . worker . global_worker args = args or [ ] kwargs = kwargs or { } if self . _ray_is_cross_language : list_args = cross_language . format_args ( worker , args , kwargs ) function_descriptor = cross_language . get_function_descriptor_for_actor_method ( self . _ray_actor_language , self . _ray_actor_creation_function_descriptor , method_name , signature = str ( len ( args ) + len ( kwargs ) ) , ) else : function_signature = self . _ray_method_signatures [ method_name ] if not args and not kwargs and not function_signature : list_args = [ ] else : list_args = signature . flatten_args ( function_signature , args , kwargs ) function_descriptor = self . _ray_function_descriptor [ method_name ] if worker . mode == ray . LOCAL_MODE : assert ( not self . _ray_is_cross_language ) , "Cross language remote actor method cannot be executed locally." object_refs = worker . core_worker . submit_actor_task ( self . _ray_actor_language , self . _ray_actor_id , function_descriptor , list_args , name , num_returns , self . _ray_actor_method_cpus , concurrency_group_name if concurrency_group_name is not None else b"" , ) if len ( object_refs ) == 1 : object_refs = object_refs [ 0 ] elif len ( object_refs ) == 0 : object_refs = None return object_refs
Method execution stub for an actor handle.
Method execution stub for an actor handle .
"""Method execution stub for an actor handle.

        This is the function that executes when
        `actor.method_name.remote(*args, **kwargs)` is called. Instead of
        executing locally, the method is packaged as a task and scheduled
        to the remote actor instance.

        Args:
            method_name: The name of the actor method to execute.
            args: A list of arguments for the actor method.
            kwargs: A dictionary of keyword arguments for the actor method.
            name (str): The name to give the actor method call task.
            num_returns (int): The number of return values for the method.

        Returns:
            object_refs: A list of object refs returned by the remote actor
                method.
        """ # noqa: E501 # The signature for xlang should be "{length_of_arguments}" to handle # overloaded methods.
A list of object refs returned by the remote actor
method.
A list of object refs returned by the remote actor method .
object_refs
self
method_name
The name of the actor method to execute.
The name of the actor method to execute .
args
A list of arguments for the actor method.
A list of arguments for the actor method .
kwargs
A dictionary of keyword arguments for the actor method.
A dictionary of keyword arguments for the actor method .
name
The name to give the actor method call task.
The name to give the actor method call task .
num_returns
The number of return values for the method.
The number of return values for the method .
concurrency_group_name