executePendingJobs method

int executePendingJobs({
  1. int maxJobs = 10000,
})

Drain the QuickJS job queue until empty or maxJobs jobs run. Returns the number of jobs executed, or stops early on error (-1 job).

Implementation

int executePendingJobs({int maxJobs = 10000}) {
  var n = 0;
  while (n < maxJobs) {
    final r = executePendingJob();
    if (r <= 0) break;
    n++;
  }
  return n;
}