Private
constructorPrivate
#abortPrivate
#abortedPrivate
#finalizersPrivate
#invocationPrivate
#resonatePrivate
#resourcesPrivate
#stopReadonly
invocationCreates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected.
A new ResonatePromise.
Creates a Promise that is resolved with an array of results when all of the provided Promises resolve or reject.
A new Promise.
Invoke a Resonate function in detached mode. Functions must first be registered with Resonate. a detached invocation will not be implecitly awaited at the end of the current context, instead it will be "supervised" as a top level invocation.
The function name.
A unique id for the function invocation.
Rest
...argsWithOverrides: any[]The function arguments and options overrides.
A Res.
Retrieves a resource by name from the current context or its parent contexts.
The unique string identifier of the resource to retrieve.
The resource of type R if found, or undefined if not found.
This method searches for a resource in the following order:
The method uses type assertion to cast the resource to type R. Ensure that the type parameter R matches the actual type of the stored resource to avoid runtime type errors.
Rest
...argsWithOpts: [...Params<F>[], PartialOptions?]Rest
...argsWithOpts: any[]Invoke a remote function.
The arguments to pass to the remote function.
Optional
opts: PartialOptionsOptional options.
A promise that resolves to the resolved value of the remote function.
Invoke a function.
The type of the function.
The function to invoke.
Rest
...argsWithOpts: [...Params<F>[], PartialOptions?]A promise that resolves to the return value of the function.
Sets a named resource for the current context and optionally adds a finalizer.
A unique string identifier for the resource.
The resource to be stored. Can be of any type.
Optional
finalizer: (() => Promise<void>)Optional. An asynchronous function to be executed when the context ends. Finalizers are run in reverse order of their addition to the context and must not fail.
Throws an error if a resource with the same name already exists in the current context.
This method associates a resource with a unique name in the current context. If a finalizer is provided, it will be executed when the context ends. Finalizers are useful for cleanup operations, such as closing connections or freeing resources.
Static
createStatic
create
Adds a finalizer function to be executed at the end of the current context. Finalizers are run in reverse order of their definition (last-in, first-out).