Undocumented
| Method | __call__ |
Undocumented |
| Method | __eq__ |
Undocumented |
| Method | __hash__ |
Undocumented |
| Method | __init__ |
Undocumented |
| Method | begin |
Run a registered function remotely with Resonate and returns a handle. |
| Method | begin |
Run a registered function asynchronously with Resonate. |
| Method | options |
Configure invocation options for a registered function. |
| Method | rpc |
Run a registered function remotely with Resonate and waits for the result. |
| Method | run |
Run a registered function with Resonate and waits for the result. |
| Class Variable | __name__ |
Undocumented |
| Class Variable | __type |
Undocumented |
| Property | func |
Undocumented |
| Property | name |
Undocumented |
| Instance Variable | _func |
Undocumented |
| Instance Variable | _name |
Undocumented |
| Instance Variable | _opts |
Undocumented |
| Instance Variable | _resonate |
Undocumented |
Resonate, name: str, func: Callable[ Concatenate[ Context, P], R], opts: Options):
¶
Undocumented
Function[ P, Generator[ Any, Any, T] | T], id: str, *args: P.args, **kwargs: P.kwargs) -> Handle[ T]:
¶
Run a registered function remotely with Resonate and returns a handle.
This method schedules the specified function for remote execution under a
durable promise identified by the given id. The function runs on a remote
worker or process as part of the distributed execution environment.
Unlike Function.rpc, this method is non-blocking and immediately returns
a Handle[T] object that can be awaited or queried later to retrieve the final
result once remote execution completes.
If a durable promise with the same id already exists, Resonate subscribes to
its result or returns it immediately if it has already completed. Duplicate
executions for the same id are automatically prevented, ensuring idempotent
and consistent behavior.
| Parameters | |
id:str | The unique identifier of the durable promise. Reusing an ID ensures idempotent remote execution. |
*args:P.args | Positional arguments passed to the function. |
**kwargs:P.kwargs | Keyword arguments passed to the function. |
| Returns | |
Handle[T] | A handle representing the asynchronous remote execution. The handle can be awaited or inspected for completion and results. |
Function[ P, Generator[ Any, Any, T] | T], id: str, *args: P.args, **kwargs: P.kwargs) -> Handle[ T]:
¶
Run a registered function asynchronously with Resonate.
This method schedules the function for execution under a durable promise
identified by the given id. If a promise with the same id already exists,
Resonate subscribes to its result or returns it immediately if it has completed.
Unlike Function.run, this method is non-blocking and returns a handle
(Handle[T]) that can be awaited or queried later for the final result.
Duplicate executions for the same id are automatically prevented, ensuring
idempotent and consistent behavior across distributed runs.
| Parameters | |
id:str | The unique identifier of the durable promise. Reusing an ID ensures idempotent execution. |
*args:P.args | Positional arguments passed to the function. |
**kwargs:P.kwargs | Keyword arguments passed to the function. |
| Returns | |
Handle[T] | A handle representing the asynchronous execution. The handle can be awaited or inspected for status and results. |
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 invocation options for a registered function.
This method allows fine-grained control over how a function is invoked, including encoding, idempotency behavior, retry strategy, timeout policy, and targeting.
These options modify the metadata and runtime behavior of the function without altering its implementation. They can be applied directly or through decorators to customize invocation semantics for specific workloads.
| Parameters | |
encoder:Encoder[Any, str | None], optional | Custom data encoder used for serializing inputs or outputs. |
idempotencystr | Callable[[str], str], optional | Explicit key or a callable that derives an idempotency key from the promise ID. Ensures repeated invocations with the same key reuse prior results. |
retryRetryPolicy | Callable[[Callable], RetryPolicy], optional | Retry strategy defining how failed invocations are retried. Common options include exponential, constant, linear, or never. |
tags:dict[str, str], optional | Metadata tags applied to the durable promise representing the invocation. Useful for tracing and filtering. |
target:str, optional | The target node, worker group, or endpoint to route the invocation to. |
timeout:float, optional | Maximum number of seconds before the invocation
times out. If None, no timeout is enforced. |
version:int, optional | Specific version of the function to invoke. Useful for staged rollouts or backward compatibility. |
| Returns | |
Function[P, R] | The function configured with the specified invocation options. |
Function[ P, Generator[ Any, Any, T] | T], id: str, *args: P.args, **kwargs: P.kwargs) -> T:
¶
Run a registered function remotely with Resonate and waits for the result.
This method executes the specified function on a remote worker or process under
a durable promise identified by the given id. If a promise with the same id
already exists, Resonate subscribes to its result or returns it immediately if
it has already completed.
This is a blocking operation, and execution will not continue until the remote function completes and returns its result.
Duplicate executions for the same id are automatically prevented, ensuring
idempotent and consistent behavior across distributed runs.
| Parameters | |
id:str | The unique identifier of the durable promise. Reusing an ID ensures idempotent remote execution. |
*args:P.args | Positional arguments passed to the function. |
**kwargs:P.kwargs | Keyword arguments passed to the function. |
| Returns | |
T | The final result returned from the remote function execution. |
Function[ P, Generator[ Any, Any, T] | T], id: str, *args: P.args, **kwargs: P.kwargs) -> T:
¶
Run a registered function with Resonate and waits for the result.
This method executes the specified function under a durable promise identified
by the given id. If a promise with the same id already exists, Resonate
subscribes to its result or returns it immediately if it has completed.
Duplicate executions for the same id are automatically prevented, ensuring
idempotent and consistent behavior across distributed runs.
This is a blocking operation—execution will not continue until the function result is available.
| Parameters | |
id:str | The unique identifier of the durable promise. Reusing an ID ensures idempotent execution. |
*args:P.args | Positional arguments passed to the function. |
**kwargs:P.kwargs | Keyword arguments passed to the function. |
| Returns | |
T | The final result of the executed function. |