Skip to content
1 min read · 160 words

Interface: IsolatedFunctionHandle<A, R>

Defined in: src/batteries/isolation/isolate_function.ts:133

The live handle returned by isolateFunction.

Type Parameters

Type Parameter
A extends unknown[]
R

Properties

PropertyTypeDescriptionDefined in
dispose() => voidTerminate the guest Worker and revoke its Blob URL. Every in-flight (and future) invoke() call rejects with @nhtio/adk/batteries/isolation!E_ISOLATED_TERMINATED. Idempotent.src/batteries/isolation/isolate_function.ts:148
invoke(...args: A) => Promise<R>Invoke the isolated function with args, returning its result (or rejecting with whatever it threw/rejected with, reconstructed as a plain Error). Lazily spawns the guest Worker on the first call; subsequent calls reuse it. Throws E_ISOLATE_FUNCTION_ARG_UNSUPPORTED when an argument cannot cross into the guest. Throws @nhtio/adk/batteries/isolation!E_ISOLATION_UNSUPPORTED_ENV when no browser Worker global is present. Throws @nhtio/adk/batteries/isolation!E_ISOLATED_CRASHED when the guest has crashed. Throws @nhtio/adk/batteries/isolation!E_ISOLATED_TERMINATED after dispose().src/batteries/isolation/isolate_function.ts:145