submit<T> method
Implementation
Future<T> submit<T>(Future<T> Function() task) async {
final completer = Completer<T>();
_count.update((v) => v + 1);
_queue.add(
() => completer.completeWith(task),
);
try {
return await completer.future;
} finally {
_count.update((v) => v - 1);
}
}