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

Unified Diff: third_party/pkg/barback-0.13.0/lib/src/group_runner.dart

Issue 291843011: Run pub tests against older versions of barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 7 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
Index: third_party/pkg/barback-0.13.0/lib/src/group_runner.dart
diff --git a/pkg/barback/lib/src/graph/group_runner.dart b/third_party/pkg/barback-0.13.0/lib/src/group_runner.dart
similarity index 73%
copy from pkg/barback/lib/src/graph/group_runner.dart
copy to third_party/pkg/barback-0.13.0/lib/src/group_runner.dart
index e609ba22bbe6fa30d09fd1e76ddf50af27002c98..970d4aa4ceed9599176883c6b2ea0c6a2e6be6e7 100644
--- a/pkg/barback/lib/src/graph/group_runner.dart
+++ b/third_party/pkg/barback-0.13.0/lib/src/group_runner.dart
@@ -2,17 +2,16 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library barback.graph.group_runner;
+library barback.group_runner;
import 'dart:async';
-import '../asset/asset_node.dart';
-import '../log.dart';
-import '../transformer/transformer_group.dart';
-import '../utils/stream_pool.dart';
import 'asset_cascade.dart';
-import 'node_status.dart';
+import 'asset_node.dart';
+import 'log.dart';
import 'phase.dart';
+import 'stream_pool.dart';
+import 'transformer_group.dart';
/// A class that processes all of the phases in a single transformer group.
///
@@ -27,16 +26,19 @@ class GroupRunner {
/// The phases defined by this group.
final _phases = new List<Phase>();
- /// How far along [this] is in processing its assets.
- NodeStatus get status {
+ /// Whether [this] is dirty and still has more processing to do.
+ bool get isDirty {
// Just check the last phase, since it will check all the previous phases
// itself.
- return _phases.last.status;
+ return _phases.last.isDirty;
}
- /// A stream that emits an event every time the group's status changes.
- Stream<NodeStatus> get onStatusChange => _onStatusChange;
- Stream _onStatusChange;
+ /// A stream that emits an event whenever [this] is no longer dirty.
+ ///
+ /// This is synchronous in order to guarantee that it will emit an event as
+ /// soon as [isDirty] flips from `true` to `false`.
+ Stream get onDone => _onDone;
+ Stream _onDone;
/// A stream that emits any new assets emitted by [this].
///
@@ -50,14 +52,14 @@ class GroupRunner {
Stream<LogEntry> get onLog => _onLogPool.stream;
final _onLogPool = new StreamPool<LogEntry>.broadcast();
- GroupRunner(Phase previous, this._group, this._location) {
- _addPhase(previous.addPhase(_location), []);
+ GroupRunner(AssetCascade cascade, this._group, this._location) {
+ _addPhase(new Phase(cascade, _location), []);
for (var phase in _group.phases) {
_addPhase(_phases.last.addPhase(), phase);
}
_onAsset = _phases.last.onAsset;
- _onStatusChange = _phases.last.onStatusChange;
+ _onDone = _phases.last.onDone;
}
/// Add a phase with [contents] to [this]'s list of phases.
@@ -78,9 +80,13 @@ class GroupRunner {
}
}
+ /// Adds a new asset as an input for this group.
+ void addInput(AssetNode node) {
+ _phases.first.addInput(node);
+ }
+
/// Removes this group and all sub-phases within it.
void remove() {
- _onLogPool.close();
for (var phase in _phases) {
phase.remove();
}
« no previous file with comments | « third_party/pkg/barback-0.13.0/lib/src/file_pool.dart ('k') | third_party/pkg/barback-0.13.0/lib/src/internal_asset.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698