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

Side by Side Diff: pkg/barback/lib/src/transform_node.dart

Issue 107303004: Don't limit transformer parallelism in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library barback.transform_node; 5 library barback.transform_node;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:source_maps/span.dart'; 9 import 'package:source_maps/span.dart';
10 10
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 // Clear all the old input subscriptions. If an input is re-used, we'll 122 // Clear all the old input subscriptions. If an input is re-used, we'll
123 // re-subscribe. 123 // re-subscribe.
124 for (var subscription in _inputSubscriptions.values) { 124 for (var subscription in _inputSubscriptions.values) {
125 subscription.cancel(); 125 subscription.cancel();
126 } 126 }
127 _inputSubscriptions.clear(); 127 _inputSubscriptions.clear();
128 128
129 _isDirty = false; 129 _isDirty = false;
130 130
131 return phase.cascade.graph.transformPool 131 return transformer.apply(transform).catchError((error, stack) {
132 .withResource(() => transformer.apply(transform))
133 .catchError((error, stack) {
134 // If the transform became dirty while processing, ignore any errors from 132 // If the transform became dirty while processing, ignore any errors from
135 // it. 133 // it.
136 if (_isDirty) return; 134 if (_isDirty) return;
137 135
138 if (error is! MissingInputException) { 136 if (error is! MissingInputException) {
139 error = new TransformerException(info, error, stack); 137 error = new TransformerException(info, error, stack);
140 } 138 }
141 139
142 // Catch all transformer errors and pipe them to the results stream. 140 // Catch all transformer errors and pipe them to the results stream.
143 // This is so a broken transformer doesn't take down the whole graph. 141 // This is so a broken transformer doesn't take down the whole graph.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 return brandNewOutputs; 213 return brandNewOutputs;
216 } 214 }
217 215
218 void _log(AssetId asset, LogLevel level, String message, Span span) { 216 void _log(AssetId asset, LogLevel level, String message, Span span) {
219 // If the log isn't already associated with an asset, use the primary. 217 // If the log isn't already associated with an asset, use the primary.
220 if (asset == null) asset = primary.id; 218 if (asset == null) asset = primary.id;
221 var entry = new LogEntry(info, asset, level, message, span); 219 var entry = new LogEntry(info, asset, level, message, span);
222 _onLogController.add(entry); 220 _onLogController.add(entry);
223 } 221 }
224 } 222 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/pool.dart ('k') | pkg/barback/test/package_graph/many_parallel_transformers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698