Skip to content
3 min read · 558 words

batteries/isolation

Remarks

This module ships the full isolation battery: the protocol substrate itself — wire envelopes, correlation engines, the tiered codec, crash-escalation policy, and observability — plus a real browser Web Worker IsolationTransport (spawnIsolated/createWorkerTransport) and the blob-URL isolateFunction escape hatch. Both implement IsolationTransport/PortLike against the real environment and plug straight into createIsolatedService/serveIsolated unmodified.

This barrel is re-exported from src/batteries/index.ts — it is reachable via import { ... } from '@nhtio/adk/batteries' like every other battery domain. Opt-in still applies at the usage level: importing the batteries barrel (or this subpath directly via @nhtio/adk/batteries/isolation) is what pulls the code into a consumer's bundle, and a consumer who imports neither pays nothing.

The node child_process IsolationTransport is the one exception: it is not re-exported here (or from the batteries barrel) because it touches node:child_process, which is unsafe to pull into a browser-loadable entry point. It remains reachable only via the deep import @nhtio/adk/batteries/isolation/child_process.

References

BrowserErrorEvent

Re-exports BrowserErrorEvent


BrowserMessageEvent

Re-exports BrowserMessageEvent


BrowserWorker

Re-exports BrowserWorker


BrowserWorkerOptions

Re-exports BrowserWorkerOptions


CodecMode

Re-exports CodecMode


CrashInfo

Re-exports CrashInfo


CrashPolicy

Re-exports CrashPolicy


CrashPolicyOptions

Re-exports CrashPolicyOptions


CrashVerdict

Re-exports CrashVerdict


createCrashPolicy

Re-exports createCrashPolicy


createIsolatedService

Re-exports createIsolatedService


createWorkerTransport

Re-exports createWorkerTransport


DEFAULT_CRASH_POLICY_MAX_CRASHES

Re-exports DEFAULT_CRASH_POLICY_MAX_CRASHES


DEFAULT_CRASH_POLICY_WINDOW_MS

Re-exports DEFAULT_CRASH_POLICY_WINDOW_MS


defineIsolatedService

Re-exports defineIsolatedService


E_INVALID_ISOLATION_OPTIONS

Re-exports E_INVALID_ISOLATION_OPTIONS


E_ISOLATE_FUNCTION_ARG_UNSUPPORTED

Re-exports E_ISOLATE_FUNCTION_ARG_UNSUPPORTED


E_ISOLATE_FUNCTION_REQUIRES_SOURCE_REHYDRATION

Re-exports E_ISOLATE_FUNCTION_REQUIRES_SOURCE_REHYDRATION


E_ISOLATE_FUNCTION_UNSERIALIZABLE

Re-exports E_ISOLATE_FUNCTION_UNSERIALIZABLE


E_ISOLATED_CRASHED

Re-exports E_ISOLATED_CRASHED


E_ISOLATED_TERMINATED

Re-exports E_ISOLATED_TERMINATED


E_ISOLATION_ENCODER_REQUIRED

Re-exports E_ISOLATION_ENCODER_REQUIRED


E_ISOLATION_READY_TIMEOUT

Re-exports E_ISOLATION_READY_TIMEOUT


E_ISOLATION_UNENCODABLE

Re-exports E_ISOLATION_UNENCODABLE


E_ISOLATION_UNSUPPORTED_ENV

Re-exports E_ISOLATION_UNSUPPORTED_ENV


emitIsolationReport

Re-exports emitIsolationReport


EncoderModule

Re-exports EncoderModule


event

Re-exports event


EventDescriptor

Re-exports EventDescriptor


EventMap

Re-exports EventMap


GuestEndpoint

Re-exports GuestEndpoint


GuestEndpointHooks

Re-exports GuestEndpointHooks


GuestToHostEnvelope

Re-exports GuestToHostEnvelope


hasIsolationHook

Re-exports hasIsolationHook


HostEndpoint

Re-exports HostEndpoint


HostEndpointHooks

Re-exports HostEndpointHooks


HostToGuestEnvelope

Re-exports HostToGuestEnvelope


isEncoderAvailable

Re-exports isEncoderAvailable


IsolatedEmitter

Re-exports IsolatedEmitter


IsolatedEventListener

Re-exports IsolatedEventListener


IsolatedFacade

Re-exports IsolatedFacade


IsolatedFunctionHandle

Re-exports IsolatedFunctionHandle


IsolatedImplementation

Re-exports IsolatedImplementation


IsolatedImplementationFactory

Re-exports IsolatedImplementationFactory


IsolatedService

Re-exports IsolatedService


IsolatedServiceOptions

Re-exports IsolatedServiceOptions


IsolatedServiceSpec

Re-exports IsolatedServiceSpec


IsolatedServiceSpecInput

Re-exports IsolatedServiceSpecInput


IsolatedServiceState

Re-exports IsolatedServiceState


isolateFunction

Re-exports isolateFunction


IsolateFunctionOptions

Re-exports IsolateFunctionOptions


IsolationCallContext

Re-exports IsolationCallContext


IsolationObservabilityHooks

Re-exports IsolationObservabilityHooks


IsolationReport

Re-exports IsolationReport


IsolationReportCallback

Re-exports IsolationReportCallback


IsolationReportPhase

Re-exports IsolationReportPhase


IsolationTransport

Re-exports IsolationTransport


method

Re-exports method


MethodDescriptor

Re-exports MethodDescriptor


MethodMap

Re-exports MethodMap


MethodOptions

Re-exports MethodOptions


nextCorrelationId

Re-exports nextCorrelationId


PortLike

Re-exports PortLike


registerEncodableClasses

Re-exports registerEncodableClasses


resolveIsolatedServiceSpec

Re-exports resolveIsolatedServiceSpec


serveIsolated

Re-exports serveIsolated


ServeIsolatedOptions

Re-exports ServeIsolatedOptions


serveIsolatedOverPort

Re-exports serveIsolatedOverPort


spawnIsolated

Re-exports spawnIsolated


SpawnIsolatedOptions

Re-exports SpawnIsolatedOptions


stream

Re-exports stream


StreamDescriptor

Re-exports StreamDescriptor


StreamHandle

Re-exports StreamHandle


StreamMap

Re-exports StreamMap


StreamOptions

Re-exports StreamOptions


transfer

Re-exports transfer


WireEnvelope

Re-exports WireEnvelope


WireError

Re-exports WireError


wireErrorToError

Re-exports wireErrorToError


WireValue

Re-exports WireValue


WorkerResolver

Re-exports WorkerResolver