class documentation

Undocumented

Method __call__ Undocumented
Method __eq__ Undocumented
Method __hash__ Undocumented
Method __init__ Undocumented
Method begin_rpc Run a function with Resonate remotely.
Method begin_run Run a function with Resonate.
Method options Configure options for the function.
Method rpc Run a function with Resonate remotely and wait for the result.
Method run Run a function with Resonate and wait for the result.
Class Variable __name__ Undocumented
Class Variable __type_params__ Undocumented
Property func Undocumented
Property name Undocumented
Instance Variable _func Undocumented
Instance Variable _name Undocumented
Instance Variable _opts Undocumented
Instance Variable _resonate Undocumented
def __call__(self, ctx: Context, *args: P.args, **kwargs: P.kwargs) -> R:

Undocumented

def __eq__(self, other: object) -> bool:

Undocumented

def __hash__(self) -> int:

Undocumented

def __init__(self, resonate: Resonate, name: str, func: Callable[Concatenate[Context, P], R], opts: Options):

Undocumented

def begin_rpc(self: Function[P, Generator[Any, Any, T] | T], id: str, *args: P.args, **kwargs: P.kwargs) -> Handle[T]:

Run a function with Resonate remotely.

If a durable promise with the same id already exists, the method will subscribe to its result or return the value immediately if the promise has been completed.

Resonate will prevent duplicate executions for the same id.

  • Function must be registered
  • Function args and kwargs must be serializable
def begin_run(self: Function[P, Generator[Any, Any, T] | T], id: str, *args: P.args, **kwargs: P.kwargs) -> Handle[T]:

Run a function with Resonate.

If a durable promise with the same id already exists, the method will subscribe to its result or return the value immediately if the promise has been completed.

Resonate will prevent duplicate executions for the same id.

  • Function must be registered
  • Function args and kwargs must be serializable
def options(self, *, encoder: Encoder[Any, str | None] | None = None, idempotency_key: str | Callable[[str], str] | None = None, retry_policy: RetryPolicy | Callable[[Callable], RetryPolicy] | None = None, tags: dict[str, str] | None = None, target: str | None = None, timeout: float | None = None, version: int | None = None) -> Function[P, R]:

Configure options for the function.

  • encoder: Configure your own data encoder.
  • idempotency_key: Define the idempotency key invocation or a function that
    receives the promise id and creates an idempotency key.
  • retry_policy: Define the retry policy exponential | constant | linear | never
  • tags: Add custom tags to the durable promise representing the invocation.
  • target: Target to distribute the invocation.
  • timeout: Number of seconds before the invocation timesout.
  • version: Version of the function to invoke.
def rpc(self: Function[P, Generator[Any, Any, T] | T], id: str, *args: P.args, **kwargs: P.kwargs) -> T:

Run a function with Resonate remotely and wait for the result.

If a durable promise with the same id already exists, the method will subscribe to its result or return the value immediately if the promise has been completed.

Resonate will prevent duplicate executions for the same id.

  • Function must be registered
  • Function args and kwargs must be serializable
  • This is a blocking operation
def run(self: Function[P, Generator[Any, Any, T] | T], id: str, *args: P.args, **kwargs: P.kwargs) -> T:

Run a function with Resonate and wait for the result.

If a durable promise with the same id already exists, the method will subscribe to its result or return the value immediately if the promise has been completed.

Resonate will prevent duplicate executions for the same id.

  • Function must be registered
  • Function args and kwargs must be serializable
  • This is a blocking operation
__name__: str =

Undocumented

__type_params__: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] =

Undocumented

@property
func: Callable[Concatenate[Context, P], R] =

Undocumented

@property
name: str =

Undocumented

_func =

Undocumented

_name =

Undocumented

_opts =

Undocumented

_resonate =

Undocumented