serveIsolateRpc function

void serveIsolateRpc({
  1. required Object mainSendPort,
  2. required Object receivePort,
  3. required Map<String, IsolateRpcHandler> handlers,
  4. String disposeOp = 'dispose',
  5. Future<void> onDispose()?,
})

Web stub: isolate RPC serving requires dart:isolate, which is unavailable on web/WASM (detectors run on the main isolate). Present only so the symbol resolves on the web build; calling it throws.

The port parameters are typed Object (rather than SendPort/ReceivePort) precisely because those types live in dart:isolate; only the native build of this library is ever compiled with real ports.

Implementation

void serveIsolateRpc({
  required Object mainSendPort,
  required Object receivePort,
  required Map<String, IsolateRpcHandler> handlers,
  String disposeOp = 'dispose',
  Future<void> Function()? onDispose,
}) {
  throw UnsupportedError(
    'serveIsolateRpc is native-only; dart:isolate is unavailable on web.',
  );
}