Clone this repo:

Branches

Tags

  1. 6783914 Release resources for requests that error out. (#2) by Natalie Weizenbaum · 3 weeks ago master 1.0.1
  2. 284344c Get rid of all the library tags. by Natalie Weizenbaum · 1 year, 5 months ago
  3. a1db430 Upgrade to the new test runner. by Natalie Weizenbaum · 1 year, 11 months ago
  4. 747ac6f added author to pubspec by Kevin Moore · 2 years, 5 months ago
  5. a81f08b Update the pubspec's homepage link. by Natalie Weizenbaum · 2 years, 6 months ago

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);
  }));
}