A ResonateHandle representing the asynchronous remote execution. The handle can be awaited or inspected for completion and results.
Initiates a remote procedure call (RPC) with Resonate and returns a handle to the execution.
This method schedules a registered function for remote execution under a durable promise
identified by the provided id
. The function runs on a remote worker or process as part of
Resonate’s distributed execution environment.
Unlike rpc, this method is non-blocking and immediately returns a ResonateHandle 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.
The unique identifier of the durable promise. Reusing an ID ensures idempotent remote execution.
A ResonateHandle representing the asynchronous remote execution. The handle can be awaited or inspected for completion and results.
Initiates a remote procedure call (RPC) with Resonate and returns a handle to the execution.
This method schedules a registered function for remote execution under a durable promise
identified by the provided id
. The function runs on a remote worker or process as part of
Resonate’s distributed execution environment.
Unlike rpc, this method is non-blocking and immediately returns a ResonateHandle 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.
The unique identifier of the durable promise. Reusing an ID ensures idempotent remote execution.
Either the registered function reference or its string name to execute remotely.
A ResonateHandle representing the asynchronous remote execution. The handle can be awaited or inspected for completion and results.
Runs a registered function asynchronously with Resonate.
This method schedules the specified function for execution under a durable promise
identified by the provided id
. If a promise with the same id
already exists,
Resonate subscribes to its result or returns it immediately if it has already completed.
Unlike run, this method is non-blocking and immediately returns a ResonateHandle that can be awaited or queried later to retrieve the final result once execution completes.
Duplicate executions for the same id
are automatically prevented, ensuring idempotent
and consistent behavior across distributed runs.
A ResonateHandle representing the asynchronous execution. The handle can be awaited or inspected for status and results.
Runs a registered function asynchronously with Resonate.
This method schedules the specified function for execution under a durable promise
identified by the provided id
. If a promise with the same id
already exists,
Resonate subscribes to its result or returns it immediately if it has already completed.
Unlike run, this method is non-blocking and immediately returns a ResonateHandle that can be awaited or queried later to retrieve the final result once execution completes.
Duplicate executions for the same id
are automatically prevented, ensuring idempotent
and consistent behavior across distributed runs.
The unique identifier of the durable promise. Reusing an ID ensures idempotent execution.
A ResonateHandle representing the asynchronous execution. The handle can be awaited or inspected for status and results.
Runs a registered function asynchronously with Resonate.
This method schedules the specified function for execution under a durable promise
identified by the provided id
. If a promise with the same id
already exists,
Resonate subscribes to its result or returns it immediately if it has already completed.
Unlike run, this method is non-blocking and immediately returns a ResonateHandle that can be awaited or queried later to retrieve the final result once execution completes.
Duplicate executions for the same id
are automatically prevented, ensuring idempotent
and consistent behavior across distributed runs.
The unique identifier of the durable promise. Reusing an ID ensures idempotent execution.
Either the registered function reference or its string name to execute.
A ResonateHandle representing the asynchronous execution. The handle can be awaited or inspected for status and results.
Retrieves or subscribes to an existing execution by its unique ID.
This method attaches to an existing durable promise identified by id
.
If the associated execution is still in progress, it returns a ResonateHandle
that can be awaited or observed until completion. If the execution has already
finished, the handle is immediately resolved with the stored result.
Notes:
id
must already exist.Unique identifier of the target execution or durable promise.
A ResonateHandle representing the existing execution. The handle can be awaited or queried to retrieve the final result.
Registers a function with Resonate for execution and version control.
This method makes a function available for distributed or top-level execution under a specific name and version.
Providing explicit name
or version
options allows precise control over
function identification and versioning, enabling repeatable, distributed
invocation and backward-compatible deployments.
Optional
options: { version?: number }A ResonateFunc wrapper for the registered function. When used as a decorator, returns a decorator that registers the target function upon definition.
Registers a function with Resonate for execution and version control.
This method makes a function available for distributed or top-level execution under a specific name and version.
Providing explicit name
or version
options allows precise control over
function identification and versioning, enabling repeatable, distributed
invocation and backward-compatible deployments.
Optional
options: { version?: number }A ResonateFunc wrapper for the registered function. When used as a decorator, returns a decorator that registers the target function upon definition.
Executes a registered function remotely with Resonate and waits for the result.
This method runs the specified function on a remote worker or process under a
durable promise identified by the provided id
. If a promise with the same
id
already exists, Resonate subscribes to its result or returns it immediately
if it has already completed.
Unlike beginRpc, this method is blocking — it waits for the remote function to complete and returns the final result before continuing execution.
Duplicate executions for the same id
are automatically prevented, ensuring
idempotent and consistent behavior across distributed runs.
A promise resolving to the final result returned from the remote function execution.
Executes a registered function remotely with Resonate and waits for the result.
This method runs the specified function on a remote worker or process under a
durable promise identified by the provided id
. If a promise with the same
id
already exists, Resonate subscribes to its result or returns it immediately
if it has already completed.
Unlike beginRpc, this method is blocking — it waits for the remote function to complete and returns the final result before continuing execution.
Duplicate executions for the same id
are automatically prevented, ensuring
idempotent and consistent behavior across distributed runs.
The unique identifier of the durable promise. Reusing an ID ensures idempotent remote execution.
Positional arguments passed to the remote function.
A promise resolving to the final result returned from the remote function execution.
Executes a registered function remotely with Resonate and waits for the result.
This method runs the specified function on a remote worker or process under a
durable promise identified by the provided id
. If a promise with the same
id
already exists, Resonate subscribes to its result or returns it immediately
if it has already completed.
Unlike beginRpc, this method is blocking — it waits for the remote function to complete and returns the final result before continuing execution.
Duplicate executions for the same id
are automatically prevented, ensuring
idempotent and consistent behavior across distributed runs.
The unique identifier of the durable promise. Reusing an ID ensures idempotent remote execution.
Either the registered function reference or its string name to execute remotely.
Positional arguments passed to the remote function.
A promise resolving to the final result returned from the remote function execution.
Runs a registered function with Resonate and waits for the result.
This method executes the specified function under a durable promise
identified by the provided id
. If a 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 across distributed runs.
This is a blocking operation — execution will not continue until the function result is available.
A promise resolving to the final result returned from the function execution.
Runs a registered function with Resonate and waits for the result.
This method executes the specified function under a durable promise
identified by the provided id
. If a 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 across distributed runs.
This is a blocking operation — execution will not continue until the function result is available.
The unique identifier of the durable promise. Reusing an ID ensures idempotent execution.
Positional arguments passed to the function.
A promise resolving to the final result returned from the function execution.
Runs a registered function with Resonate and waits for the result.
This method executes the specified function under a durable promise
identified by the provided id
. If a 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 across distributed runs.
This is a blocking operation — execution will not continue until the function result is available.
The unique identifier of the durable promise. Reusing an ID ensures idempotent execution.
Either the registered function reference or its string name to execute.
Positional arguments passed to the function.
A promise resolving to the final result returned from the function execution.
Static
localInitializes a Resonate client instance for local development.
Creates and returns a Resonate client configured for local-only execution with zero external dependencies. All state is stored in local memory — no network or external persistence is required. This mode is ideal for rapid testing, debugging, and experimentation before connecting to a Resonate server.
The client runs with a "default"
worker group, a "default"
process ID,
and an effectively infinite TTL (Number.MAX_SAFE_INTEGER
) for tasks.
A Resonate client instance configured for local development.
Static
remoteInitializes a Resonate client instance with remote configuration.
Creates and returns a Resonate client that connects to a Resonate Server and optional remote message sources. This configuration enables distributed, durable workers to cooperate and execute functions via durable RPCs.
By default, the client connects to a Resonate Server running locally
(http://localhost:8001
) and joins the "default"
worker group.
The client is identified by a unique process ID (pid
) and maintains
claimed task leases for the duration specified by ttl
.
Configuration options for the remote client.
Optional
auth?: { password: string; username: string }Optional authentication credentials for connecting to the remote server.
Optional
group?: stringThe worker group name. Defaults to "default"
.
Optional
messageSourceAuth?: { password: string; username: string }Optional
pid?: stringOptional process identifier for the client. Defaults to a randomly generated UUID.
Optional
ttl?: numberTime-to-live (in seconds) for claimed tasks. Defaults to 1 * util.MIN
.
Optional
url?: stringThe base URL of the remote Resonate Server. Defaults to "http://localhost:8001"
.
A Resonate client instance configured for remote operation.
Initiates a remote procedure call (RPC) with Resonate and returns a handle to the execution.
This method schedules a registered function for remote execution under a durable promise identified by the provided
id
. The function runs on a remote worker or process as part of Resonate’s distributed execution environment.Unlike rpc, this method is non-blocking and immediately returns a ResonateHandle 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 sameid
are automatically prevented, ensuring idempotent and consistent behavior.