class_docstr: A class used to invoke an actor method.
  
  Note: This class only keeps a weak ref to the actor, unless it has been
  passed to a remote function. This avoids delays in GC of the actor.
  
  Attributes:
      _actor_ref: A weakref handle to the actor.
      _method_name: The name of the actor method.
      _num_returns: The default number of return values that the method
          invocation should return. If None is given, it uses
          DEFAULT_ACTOR_METHOD_NUM_RETURN_VALS for a normal actor task
          and "streaming" for a generator task (when `is_generator` is True).
      _max_retries: [Internal] Number of retries on method failure.
      _retry_exceptions: Boolean of whether you want to retry all user-raised
          exceptions, or a list of allowlist exceptions to retry.
      _is_generator: True if a given method is a Python generator.
      _generator_backpressure_num_objects: Generator-only config.
          If a number of unconsumed objects reach this threshold,
          a actor task stop pausing.
      _decorator: An optional decorator that should be applied to the actor
          method invocation (as opposed to the actor method execution) before
          invoking the method. The decorator must return a function that
          takes in two arguments ("args" and "kwargs"). In most cases, it
          should call the function that was passed into the decorator and
          return the resulting ObjectRefs. For an example, see
          "test_decorated_method" in "python/ray/tests/test_actor.py".
class_docstr_tok: ["A","class","used","to","invoke","an","actor","method",".","Note",":","This","class","only","keeps","a","weak","ref","to","the","actor",",","unless","it","has","been","passed","to","a","remote","function",".","This","avoids","delays","in","GC","of","the","actor",".","Attributes",":","_actor_ref",":","A","weakref","handle","to","the","actor",".","_method_name",":","The","name","of","the","actor","method",".","_num_returns",":","The","default","number","of","return","values","that","the","method","invocation","should","return",".","If","None","is","given",",","it","uses","DEFAULT_ACTOR_METHOD_NUM_RETURN_VALS","for","a","normal","actor","task","and","``","streaming","''","for","a","generator","task","(","when","`","is_generator","`","is","True",")",".","_max_retries",":","[","Internal","]","Number","of","retries","on","method","failure",".","_retry_exceptions",":","Boolean","of","whether","you","want","to","retry","all","user-raised","exceptions",",","or","a","list","of","allowlist","exceptions","to","retry",".","_is_generator",":","True","if","a","given","method","is","a","Python","generator",".","_generator_backpressure_num_objects",":","Generator-only","config",".","If","a","number","of","unconsumed","objects","reach","this","threshold",",","a","actor","task","stop","pausing",".","_decorator",":","An","optional","decorator","that","should","be","applied","to","the","actor","method","invocation","(","as","opposed","to","the","actor","method","execution",")","before","invoking","the","method",".","The","decorator","must","return","a","function","that","takes","in","two","arguments","(","``","args","''","and","``","kwargs","''",")",".","In","most","cases",",","it","should","call","the","function","that","was","passed","into","the","decorator","and","return","the","resulting","ObjectRefs",".","For","an","example",",","see","``","test_decorated_method","''","in","``","python\/ray\/tests\/test_actor.py","''","."]
code: def __getstate__(self):
      return {
          "actor": self._actor_ref(),
          "method_name": self._method_name,
          "num_returns": self._num_returns,
          "max_retries": self._max_retries,
          "retry_exceptions": self._retry_exceptions,
          "decorator": self._decorator,
          "is_generator": self._is_generator,
          "generator_backpressure_num_objects": self._generator_backpressure_num_objects,  # noqa
      }
  
imports: import inspect
  import logging
  import weakref
  from typing import Any, Dict, List, Optional, Union
  import ray._private.ray_constants
  import ray._private.signature
  import ray._private.worker
  import ray._raylet
  from ray import ActorClassID, Language, cross_language
  from ray._private import ray_option_utils
  from ray._private.async_compat import is_async_func
  from ray._private.auto_init_hook import wrap_auto_init
  from ray._private.client_mode_hook import client_mode_convert_actor, client_mode_hook, client_mode_should_convert
  from ray._private.inspect_util import is_class_method, is_function_or_method, is_static_method
  from ray._private.ray_option_utils import _warn_if_using_deprecated_placement_group
  from ray._private.utils import get_runtime_env_info, parse_runtime_env
  from ray._raylet import STREAMING_GENERATOR_RETURN, ObjectRefGenerator, PythonFunctionDescriptor, raise_sys_exit_with_custom_error_message
  from ray.exceptions import AsyncioActorExit
  from ray.util.annotations import DeveloperAPI, PublicAPI
  from ray.util.placement_group import _configure_placement_group_based_on_context
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy, SchedulingStrategyT
  from ray.util.tracing.tracing_helper import _inject_tracing_into_class, _tracing_actor_creation, _tracing_actor_method_invocation
label_desc: Use image node_id 8 for calling the ActorMethod obj's underlying member method code with example usage: obj.__getstate__() and returns: dict