commit | 40a8f35e7fc4961c13fc95034e8bb8caf733bc06 | [log] [tgz] |
---|---|---|
author | Kevin Moore <kevmoo@users.noreply.github.com> | Fri Sep 01 10:00:11 2017 -0700 |
committer | GitHub <noreply@github.com> | Fri Sep 01 10:00:11 2017 -0700 |
tree | 30ada6a67c691104735a12883079f35f7e61688b | |
parent | df18e7a279a201269990b18e4c3807fe56db56b8 [diff] |
dartfmt (#5)
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); })); }