execute method

Future<void> execute([
  1. bool loop = false
])

Implementation

Future<void> execute([bool loop = false]) async {
  if (!loop && runner) return;
  runner = true;

  if (list.isEmpty) {
    runner = false;
    return;
  }

  final FutureFunction fn = list[0];
  await fn();

  list.removeAt(0);

  await execute(true);
}