__init__#
- ActorMethod.__init__(actor: ActorHandle, method_name: str, num_returns: int | Literal['streaming'] | None, max_task_retries: int, retry_exceptions: bool | list | tuple, is_generator: bool, generator_backpressure_num_objects: int, num_objects_per_yield: int, enable_task_events: bool, decorator: Callable | None = None, signature: List[Parameter] | None = None, tensor_transport: str | None = None)[source]#
Initialize an ActorMethod.
- Parameters:
actor (ActorHandle) – The actor instance this method belongs to.
method_name (str) – The name of the actor method.
num_returns (int | Literal['streaming'] | None) – 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_generatoris True).max_task_retries (int) – Number of retries on method failure.
retry_exceptions (bool | list | tuple) – Boolean of whether you want to retry all user-raised exceptions, or a list of allowlist exceptions to retry.
is_generator (bool) – True if a given method is a Python generator.
generator_backpressure_num_objects (int) – Generator-only config. If a number of unconsumed objects reach this threshold, the actor task stops pausing.
num_objects_per_yield (int) – Private generator-only config for grouped yields.
enable_task_events (bool) – True if task events is enabled, i.e., task events from the actor should be reported. Defaults to True.
decorator (Callable | None) – An optional decorator that should be applied to the actor method invocation.
signature (List[Parameter] | None) – The signature of the actor method. It is None only when cross language feature is used.
tensor_transport (str | None) – The tensor transport protocol to use for the actor method.