execute method

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

Implementation

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

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

  await list.first();

  list.removeAt(0);

  runner = false;

  if (loop) await execute(loop);
}