executeAsync method

Future<bool> executeAsync(
  1. Future<void> action()
)

Execute the action asynchronously if within rate limit

Implementation

Future<bool> executeAsync(Future<void> Function() action) async {
  if (canExecute()) {
    _callTimes.add(DateTime.now());
    await action();
    return true;
  }
  return false;
}