Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: pkg/http_throttle/README.md

Issue 418103004: Add an http_throttle package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/http_throttle/LICENSE ('k') | pkg/http_throttle/lib/http_throttle.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 `http_throttle` is middleware for the [http package][] that throttles the number
2 of concurrent requests that an HTTP client can make.
3
4 ```dart
5 // This client allows 32 concurrent requests.
6 final client = new ThrottleClient(32);
7
8 Future<List<String>> readAllUrls(Iterable<Uri> urls) {
9 return Future.wait(urls.map((url) {
10 // You can safely call as many client methods as you want concurrently, and
11 // ThrottleClient will ensure that only 32 underlying HTTP requests will be
12 // open at once.
13 return client.read(url);
14 }));
15 }
16 ```
17
18 [http package]: pub.dartlang.org/packages/http
OLDNEW
« no previous file with comments | « pkg/http_throttle/LICENSE ('k') | pkg/http_throttle/lib/http_throttle.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698