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

Unified Diff: pkg/polymer/lib/src/build/runner.dart

Issue 26273003: Pool future creation to ensure no more than 10 ops are in flight (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: using in polymer Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/barback/lib/src/utils.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/build/runner.dart
diff --git a/pkg/polymer/lib/src/build/runner.dart b/pkg/polymer/lib/src/build/runner.dart
index 064ac089e4b14934ab5e234949bc0a02ab9a4da3..cada2d50db1973e4e22d2aa9d1d3396455de8d4c 100644
--- a/pkg/polymer/lib/src/build/runner.dart
+++ b/pkg/polymer/lib/src/build/runner.dart
@@ -14,6 +14,7 @@ import 'dart:io';
import 'package:args/args.dart';
import 'package:barback/barback.dart';
+import 'package:barback/src/utils.dart' show forEachPooledFuture;
import 'package:path/path.dart' as path;
import 'package:stack_trace/stack_trace.dart';
import 'package:yaml/yaml.dart';
@@ -211,7 +212,7 @@ Future _emitTransformedFiles(AssetSet assets, BarbackOptions options) {
var transformTests = options.transformTests;
var outPackages = path.join(options.outDir, 'packages');
- return Future.forEach(assets, (asset) {
+ return forEachPooledFuture(assets, (asset) {
var id = asset.id;
var dir = _firstDir(id.path);
if (dir == null) return null;
@@ -273,8 +274,8 @@ Future _emitPackagesDir(BarbackOptions options) {
// Copy all the files we didn't process
var dirs = options.packageDirs;
- return Future.forEach(_polymerPackageDependencies, (package) {
- return Future.forEach(_listPackageDir(package, 'lib', options), (relpath) {
+ return forEachPooledFuture(_polymerPackageDependencies, (package) {
+ return forEachPooledFuture(_listPackageDir(package, 'lib', options), (relpath) {
var inpath = path.join(dirs[package], relpath);
var outpath = path.join(outPackages, package, relpath.substring(4));
return _copyFile(inpath, outpath);
« no previous file with comments | « pkg/barback/lib/src/utils.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698