run method

void run(
  1. ThrottlerAction action
)

Runs action under the current throttling rules.

Implementation

void run(ThrottlerAction action) {
  _ensureNotDisposed();
  if (_isThrottled) {
    if (trailing) _pendingAction = action;
    return;
  }

  if (leading) {
    _executeAction(action);
  } else if (trailing) {
    _pendingAction = action;
  }

  _startTimer();
}