dispatch method

  1. @override
Future<Object?> dispatch(
  1. String verb,
  2. List<Object?> args
)
override

Dispatch a verb invocation. Returns any JSON-serialisable value (or a Future thereof) — the bridge JSON-encodes and hands back to the JS Promise. Throw to reject the promise.

args is the list passed by JS (host.fs.read(path)[path]). Atoms validate arity / types and throw ArgumentError for schema violations so the JS caller gets a clean error message.

Implementation

@override
Future<Object?> dispatch(String verb, List<Object?> args) async {
  final b = bridge;
  final s = session;
  if (b != null && s != null) {
    return b.runScoped(s, () => _dispatchInner(verb, args));
  }
  return _dispatchInner(verb, args);
}