http_throttle 1.0.2 copy "http_throttle: ^1.0.2" to clipboard
http_throttle: ^1.0.2 copied to clipboard

discontinued
outdatedDart 1 only

HTTP client middleware that throttles requests.

http_throttle is middleware for the http package that throttles the number of concurrent requests that an HTTP client can make.

// This client allows 32 concurrent requests.
final client = new ThrottleClient(32);

Future<List<String>> readAllUrls(Iterable<Uri> urls) {
  return Future.wait(urls.map((url) {
    // You can safely call as many client methods as you want concurrently, and
    // ThrottleClient will ensure that only 32 underlying HTTP requests will be
    // open at once.
    return client.read(url);
  }));
}
2
likes
0
pub points
20%
popularity

Publisher

unverified uploader

HTTP client middleware that throttles requests.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http, pool

More

Packages that depend on http_throttle