run<T> method

Future<T> run<T>(
  1. Future<T> callback()
)

Implementation

Future<T> run<T>(Future<T> Function() callback) async {
  await acquire();
  try {
    final result = await callback();
    return result;
  } finally {
    release();
  }
}