withPermit<T> method
Implementation
Future<T> withPermit<T>(Future<T> Function() action) async {
await acquire();
try {
final stopwatch = Stopwatch()..start();
final t = await action();
onEachCompleted(stopwatch.elapsed.inMilliseconds);
stopwatch.stop();
return t;
} finally {
release();
}
}