allowRequest method
Implementation
bool allowRequest() {
final now = _clock.elapsedMicroseconds;
_tokens += (now - _lastRefill) * _rate / 1e6;
_tokens = min(_tokens, _capacity);
_lastRefill = now;
if (_tokens > 0) {
_tokens--;
return true;
} else {
return false;
}
}