commit | 6783914d90a061a3a4c1766218c7909f42de2b4c | [log] [tgz] |
---|---|---|
author | Natalie Weizenbaum <nweiz@google.com> | Fri Jun 02 14:50:12 2017 -0700 |
committer | GitHub <noreply@github.com> | Fri Jun 02 14:50:12 2017 -0700 |
tree | 7eca48afc6d3a4f49d883040fed12e1577e49b72 | |
parent | 284344cd357e435c6c8ff9a4a21f02b9e384a541 [diff] |
Release resources for requests that error out. (#2) This was causing dart-lang/pub#1610
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); })); }