dispatch method

Future<void> dispatch()

Dispatch JavaScript Event loop.

Implementation

Future<void> dispatch() async {
  final rt = _rt;
  final opaque = rt == null ? null : runtimeOpaques[rt];
  if (opaque != null) opaque.eventLoopActive = true;
  try {
    await for (final _ in port) {
      _executePendingJob();
    }
  } finally {
    if (opaque != null) opaque.eventLoopActive = false;
  }
}