RateLimiter class
A rate limiter for web scraping to avoid overwhelming target websites
Constructors
-
RateLimiter.new({int defaultDelayMs = 1000, Map<
String, int> ? domainDelays}) - Creates a new RateLimiter with the given parameters
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
execute<
T> ({required String url, required Future< T> fn()}) → Future<T> - Executes a function with rate limiting
-
getDomainDelay(
String domain) → int - Gets the current delay for a domain
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setDomainDelay(
String domain, int delayMs) → void - Sets a custom delay for a domain
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited